Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created 10 separate workbooks, each with its own macro. I want
to create one macro that opens each workbook, runs the macro, then closes the workbook and the moves to the next workbook. Currently, my code is simple. Workbooks.open filename application.run filename!macro workbook.close Workbooks.open filename application.run filename!macro workbook.close etc... the macro is stopping after it completes the first macro. Any help would be appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() wrote in message ups.com... I have created 10 separate workbooks, each with its own macro. I want to create one macro that opens each workbook, runs the macro, then closes the workbook and the moves to the next workbook. Currently, my code is simple. Workbooks.open filename application.run filename!macro workbook.close Workbooks.open filename application.run filename!macro workbook.close etc... the macro is stopping after it completes the first macro. Any help would be appreciated. HI Have you tried putting the macro you want to run in each seprate workbook in the work book open events of those objects. The macros would then run automatically everytime the workbook was opened. N10 :) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about doing something like this
Dim oWB as workbook set oWB = Workbooks.open filename application.run filename!macro(oWB) 'Pass oWB to the macro owb.close How do you loop through each filename? " wrote: I have created 10 separate workbooks, each with its own macro. I want to create one macro that opens each workbook, runs the macro, then closes the workbook and the moves to the next workbook. Currently, my code is simple. Workbooks.open filename application.run filename!macro workbook.close Workbooks.open filename application.run filename!macro workbook.close etc... the macro is stopping after it completes the first macro. Any help would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I need a macro that runs other macros until P5=28 | Excel Discussion (Misc queries) | |||
Need Help Creating a Macro Multiple Workbooks to One | Excel Worksheet Functions | |||
How to stop other macros while current macro runs | Excel Programming | |||
VLookUp when Macro Opens WorkBooks | Excel Programming | |||
VLookUp when Macro Opens WorkBooks | Excel Programming |