o0omax
08-09-2022, 02:21 AM
Hello,
i am currently working on an VBA Project which opens and closes different Workbooks (and PowerPoints). What are Best Practices concerning this undertaking?
Do i create a new Application for every WorkBook i open in a loop? -> set xlAPP = CreateObject("Excel.Application") [or CreateObject("PowerPoint.Application") for PowerPoint
Do i declare a different variable for each Workbook, even the one i'm running the macro from? -> set wb = Workbooks.Open(Name)
When do I close the application of Excel/Powerpoint? When do i close the opened workbook (here wb)
I did not find anything on the web and wanted to sharpen my understanding of handling those objects!
Thanks for the replies!
Greetings
o0omax
i am currently working on an VBA Project which opens and closes different Workbooks (and PowerPoints). What are Best Practices concerning this undertaking?
Do i create a new Application for every WorkBook i open in a loop? -> set xlAPP = CreateObject("Excel.Application") [or CreateObject("PowerPoint.Application") for PowerPoint
Do i declare a different variable for each Workbook, even the one i'm running the macro from? -> set wb = Workbooks.Open(Name)
When do I close the application of Excel/Powerpoint? When do i close the opened workbook (here wb)
I did not find anything on the web and wanted to sharpen my understanding of handling those objects!
Thanks for the replies!
Greetings
o0omax