F
F. Henderieckx
Hello,
I have following piece of code: Purpose is to open the AUTO_OPEN
macro's of 2 excel-sheets in sequence.
Workbooks.Open FileName:="G:\Timesheets\Code\Excel-TMT.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
Workbooks("Excel-TMT.xls").Activate
ActiveWorkbook.Close SaveChanges:=True
Workbooks.Open FileName:="G:\Timesheets\Code\Excel-PTL.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
Workbooks("Excel-PTL.xls").Activate
ActiveWorkbook.Close savechanges:=True
Problem is that apparently only the first AUTO_OPEN macro is started.
The next AUTO_OPEN macro is just skipped.
When I put a comment mark before the first
ActiveWorkbook.RunAutoMacros xlAutoOpen command, the second AUTO_OPEN
macro is started!
So it seems you can only run an AUTO_OPEN macro 1 time.
How can I get around this?
Filip Henderieckx
I have following piece of code: Purpose is to open the AUTO_OPEN
macro's of 2 excel-sheets in sequence.
Workbooks.Open FileName:="G:\Timesheets\Code\Excel-TMT.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
Workbooks("Excel-TMT.xls").Activate
ActiveWorkbook.Close SaveChanges:=True
Workbooks.Open FileName:="G:\Timesheets\Code\Excel-PTL.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
Workbooks("Excel-PTL.xls").Activate
ActiveWorkbook.Close savechanges:=True
Problem is that apparently only the first AUTO_OPEN macro is started.
The next AUTO_OPEN macro is just skipped.
When I put a comment mark before the first
ActiveWorkbook.RunAutoMacros xlAutoOpen command, the second AUTO_OPEN
macro is started!
So it seems you can only run an AUTO_OPEN macro 1 time.
How can I get around this?
Filip Henderieckx