ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro not found in Application.Run (https://www.excelbanter.com/excel-programming/363159-macro-not-found-application-run.html)

ndalal

Macro not found in Application.Run
 
Hi,

I need help with this unusual problem that does not happen when I am in
debug mode.

The following line of code is in a function defined in a VB project:
Application.Run "'" + ActiveWorkbook.Name + "'!" + macro

And I'm calling this VB function from Excel and the macro is
implemented in a VBA module in Excel. When I'm debugging, i.e. VB is
Run and then start Excel and call the VB function, the function gets
called but the Application.Run does not give any error and all works
fine.

However if I dont run VB in background, just open Excel add VB
reference and call the VB function, Application.Run says that macro not
found.

If anyone out there has any clues, please help....thanks in advance.

- Andy



All times are GMT +1. The time now is 08:46 AM.

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