Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
In VBA, Open a file with macros disabled
Excel 2002, WinXP
My macro security is set to Medium. I have a file that I need to open (in VBA) in order to extract some data from it, then close it. That file has Open and Close event code that I don't want to run during this task. How do I code to open that file with macros disabled? Or how can I code to open that file such that the Open/Close code will not execute? Thanks for your help. Otto |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
In VBA, Open a file with macros disabled
Application.EnableEvents = False
set bk = Workbooks.Open( Filename:="C:\MyFolder\MyFile.xls") ' process workbook bk.Close Application.EnableEvents = True -- Regards, Tom Ogilvy "Otto Moehrbach" wrote in message ... Excel 2002, WinXP My macro security is set to Medium. I have a file that I need to open (in VBA) in order to extract some data from it, then close it. That file has Open and Close event code that I don't want to run during this task. How do I code to open that file with macros disabled? Or how can I code to open that file such that the Open/Close code will not execute? Thanks for your help. Otto |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"excel "macros may be disabled" message using an xlam file | Excel Worksheet Functions | |||
Open file with macros | Excel Discussion (Misc queries) | |||
Macros Disabled when opening file | Excel Discussion (Misc queries) | |||
How to open a spreadsheet with Macros disabled | Excel Discussion (Misc queries) | |||
Excel crashes when attempting to open workbook...even with macros disabled | Excel Programming |