Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 1004 error when using ATPVBAEN.XLAM!Regress

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 1004 error when using ATPVBAEN.XLAM!Regress

Allan, check out the below link from Microsoft

http://support.microsoft.com/kb/192642
--
If this post helps click Yes
---------------
Jacob Skaria


"Allan_Urban" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 1004 error when using ATPVBAEN.XLAM!Regress

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.

"Jacob Skaria" wrote:

Allan, check out the below link from Microsoft

http://support.microsoft.com/kb/192642
--
If this post helps click Yes
---------------
Jacob Skaria


"Allan_Urban" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 1004 error when using ATPVBAEN.XLAM!Regress

Try copy paste the below code. Also make sure you have loaded Analysis
ToolPak - VBA

http://office.microsoft.com/en-us/ex...215691033.aspx

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


If this post helps click Yes
---------------
Jacob Skaria


"Allan_Urban" wrote:

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.

"Jacob Skaria" wrote:

Allan, check out the below link from Microsoft

http://support.microsoft.com/kb/192642
--
If this post helps click Yes
---------------
Jacob Skaria


"Allan_Urban" wrote:

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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 1004 error when using ATPVBAEN.XLAM!Regress

Works like a charm!

Thank you very much.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 1004 error when using ATPVBAEN.XLAM!Regress

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?
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 1004 error when using ATPVBAEN.XLAM!Regress

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

VBEVBAProject(Your_Filename) Microsoft Excel Objectsdouble click 'This
Workbook' and in the code panel you can list down the workbook events.

If this post helps click Yes
---------------
Jacob Skaria


"Allan_Urban" wrote:

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?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 1004 error when using ATPVBAEN.XLAM!Regress

Doesn't work. I still have to Data Data analysis Regression ...
manually before the macro works.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LOOKUP.XLAM error Joelg Excel Discussion (Misc queries) 3 April 16th 09 09:26 PM
User Interface Basics -- Have we begun to regress? gary7 Excel Discussion (Misc queries) 1 April 14th 09 12:38 AM
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 [email protected] Excel Programming 7 August 7th 08 08:43 PM
labelprint.xlam file not found error appears when excel starts Dennis Wong Excel Discussion (Misc queries) 0 June 1st 08 05:58 AM
How do I find the Regress interface in Excel Miss Kitty Excel Discussion (Misc queries) 1 April 5th 05 06:02 AM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"