ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling Analysis Toolpak.Regress (Regression) (https://www.excelbanter.com/excel-programming/451004-calling-analysis-toolpak-regress-regression.html)

[email protected]

Calling Analysis Toolpak.Regress (Regression)
 
From VBA in Outlook I instantiate and run a procedure in Excel and then Excel VBA calls "ATPVBAEN.XLAM!Regress"

I get error message "Run-time error 1004: Cannot run the macro ". The macro may not be available in this workbook or all macros may be disabled."


BUT, if I manually open the Excel workbook, the Excel VBA code and the ATP Regression runs perfectly.

The ATP reference is checked.
The two addins "Analysis ToolPak" and "Analysis ToolPak - VBA" are checked.


This may help: when it fails (from Outlook), I notice the Excel Data menu does not have the "Data Analysis" item. Yet, VBA thinks it is loaded.

Any help please???

GS[_6_]

Calling Analysis Toolpak.Regress (Regression)
 
From VBA in Outlook I instantiate and run a procedure in Excel

If you mean you are running/using an automated instance of Excel then
no addins will be loaded, and so any refs to the AnalysisToolpak will
result an error unless you load it before running your procedure!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 05:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com