1004 error when using ATPVBAEN.XLAM!Regress

A

Allan_Urban

Hi all

Im in a bit of trouble here. I need to do a OLS regression and i recorded a
macro using the Regression from the VBA Tool Pack.

But whenever i run it, I get the following error:

Run-time error '1004':
Method 'Run' of object '_Application' failed

the code looks as follows:
Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$B$2:$B$60")
ActiveSheet.Range ("$A$2:$A$60"), False, False, ,
ActiveSheet.Range("$D$8") _
, False, False, False, False, , False

I have no idea how to fix it, so I hope someone is able to help me.
Using 2007 btw.
 
A

Allan_Urban

Yeah, already tried that and it doesn't fix the problem. Instead i get
another error:

Analysis Toolpak - VBA.htm could not be found. Check the spelling of the
file name, and verify that the file location is correct.
 
A

Allan_Urban

It seems like you have to run the regression manually when you open the sheet
before it works.

Is there a way to bypass this?
 
J

Jacob Skaria

Save this as a macro and Call this macro from Workbook_Open event.

VBE>VBAProject(Your_Filename) >Microsoft Excel Objects>double click 'This
Workbook' and in the code panel you can list down the workbook events.

If this post helps click Yes
 
A

Allan_Urban

Doesn't work. I still have to Data > Data analysis > Regression >...
manually before the macro works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top