Microsoft
Software
Hardware
Network
Question : Macro not found error
Hi,
I am getting The macro 'Data Log from 69194.xls!CalculateTotal' cannot be found. error when I am trying to run a macro that resides in another work book.
Here is the code:
Dim target As Workbook
Set target = Workbooks.Open("S:\Data Log from 69194.xls")
Dim res As String
res = Application.Run(target.Nam
e & "!CalculateTotal", "1/11/2009", "2.1.3")
I have defined a a macro as Public Function(arg1, arg2) inside a module in another workbook.
Why am I getting an error when I try to call it?
Answer : Macro not found error
Hi,
Try changing this:
res = Application.Run(target.Nam
e & "!CalculateTotal", "1/11/2009", "2.1.3")
to this
res = Application.Run("'" & target.Name & "'!CalculateTotal", "1/11/2009", "2.1.3")
Regards,
Rob.
Random Solutions
Silverlight app (IIS6) is unable to serve my .svc file
Outlook not updating/refreshing inbox - have to press F9.
Need to Capture LPT1, FROM MULTIPLE PRINT JOBS, and save them all in one file
Using MS Access to open web server MySQL database - is it possible?
Delayed write c:\Mft
Exporting Access table to Excel using VBA
How do I parameterise a Union query so that a prompt it not issued each time it runs...
Excel Exception from HRESULT Error
VB.NET 3.5: how to copy an embedded resource to a file
SQL Query - Syntax ( SQL 2005 / 2008 )