ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling a macro from within a loop (https://www.excelbanter.com/excel-programming/273133-calling-macro-within-loop.html)

Rick[_12_]

calling a macro from within a loop
 
Change your statement to...

Application.Run wbTemp.xls!timesheetFeed


-----Original Message-----
I have a sub that loops through a series of files whuch

are given the name
"wbtemp" which is an xls file. After various processing

I then want to call
a macro called "timesheetfeed" contained in this file.

I am trying to do
this by this line of code with variations on using ""

etc:

Application.Run wbTemp!timesheetFeed

I get a runtime error 438 which is "object doesnt

support this method..."
can anyone suggest what to do?


.


Rick[_12_]

calling a macro from within a loop
 
OOpps .... don't forget the quotes...

Application.Run "wbTemp.xls!timesheetFeed"

LOL

-----Original Message-----
Change your statement to...

Application.Run wbTemp.xls!timesheetFeed


-----Original Message-----
I have a sub that loops through a series of files whuch

are given the name
"wbtemp" which is an xls file. After various

processing
I then want to call
a macro called "timesheetfeed" contained in this file.

I am trying to do
this by this line of code with variations on using ""

etc:

Application.Run wbTemp!timesheetFeed

I get a runtime error 438 which is "object doesnt

support this method..."
can anyone suggest what to do?


.

.



All times are GMT +1. The time now is 01:42 PM.

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