Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"excel "macros may be disabled" message using an xlam file frustrated Excel Worksheet Functions 2 July 13th 09 08:32 PM
Open file with macros David T Excel Discussion (Misc queries) 2 November 29th 07 06:23 PM
Macros Disabled when opening file snax500 Excel Discussion (Misc queries) 1 October 19th 06 09:37 PM
How to open a spreadsheet with Macros disabled Mauricio Silva Excel Discussion (Misc queries) 6 March 24th 05 01:59 PM
Excel crashes when attempting to open workbook...even with macros disabled llowwelll[_10_] Excel Programming 1 May 24th 04 09:38 PM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"