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/273105-re-calling-macro-within-loop.html)

Mike Hughes

calling a macro from within a loop
 

Mervyn,

Use this

Call timesheetfeed

Next

End Sub

In this simple eaxample when x=10 the macro "timesheetfeed" runs. Processing
will retuen to the loop
"Mervyn Thomas" wrote in 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 05:20 PM.

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