ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How: open a workbook with auto macro disabled using code? (https://www.excelbanter.com/excel-programming/323012-how-open-workbook-auto-macro-disabled-using-code.html)

mike_cutting-edge

How: open a workbook with auto macro disabled using code?
 
I am trying to open a number of workbooks from VBA in excel and I need to
open them with macros disabled or auto macro disabled. This is because the
worksheets I need to open have an auto macro which loads data from a server
and I do not want it to run.
Thanks.

Tom Ogilvy

open a workbook with auto macro disabled using code?
 
Application.EnableEvents = False
workbooks.Open "C:\MyFolder\Myfile.xls"
Application.EnableEvents = True

disables the startup macros.

--
Regards,
Tom Ogilvy

"mike_cutting-edge" wrote in
message ...
I am trying to open a number of workbooks from VBA in excel and I need to
open them with macros disabled or auto macro disabled. This is because the
worksheets I need to open have an auto macro which loads data from a

server
and I do not want it to run.
Thanks.





All times are GMT +1. The time now is 02:30 PM.

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