Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Disable Workbooks_Open() Macro when opening from VBA

I am trying to open a Workbook "Permanent File Information.xls" from a macro
in another workbook without invoking the workbooks_open macro in "Permanent
File Information.xls"

This is the equivalent of holding down the <shift key whilst opening the
workbook.

I have tried recording two macros to see what the difference is but although
they give different macros they both allow the workbooks_open macro to run
when the two macros are run.

Sub OpenWorkBook()
Workbooks.Open Filename:= _
"F:\Files\Permanent File Information.xls"
End Sub
Sub ShiftOpenWorkbook()
Workbooks.Open Filename:= _
"F:\PA Files\Permanent File Information.xls", Editable:=True
End Sub

Has anyone got any ideas how to stop the workbooks_open macro running from
VBA?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Disable Workbooks_Open() Macro when opening from VBA

Sub OpenWorkBook()
Application.EnableEvents = False
Workbooks.Open Filename:= _
"F:\Files\Permanent File Information.xls"
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"DavidUp" wrote in message
...
I am trying to open a Workbook "Permanent File Information.xls" from a

macro
in another workbook without invoking the workbooks_open macro in

"Permanent
File Information.xls"

This is the equivalent of holding down the <shift key whilst opening the
workbook.

I have tried recording two macros to see what the difference is but

although
they give different macros they both allow the workbooks_open macro to run
when the two macros are run.

Sub OpenWorkBook()
Workbooks.Open Filename:= _
"F:\Files\Permanent File Information.xls"
End Sub
Sub ShiftOpenWorkbook()
Workbooks.Open Filename:= _
"F:\PA Files\Permanent File Information.xls", Editable:=True
End Sub

Has anyone got any ideas how to stop the workbooks_open macro running from
VBA?

Thank you



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
how to disable always ask before opening this type of file jmauldin Excel Discussion (Misc queries) 2 August 8th 08 08:40 PM
Code to select 'Disable Macro' when opening an EXTERNAL FILE G rumpy O ld D uffer Excel Programming 1 March 22nd 05 05:32 PM
Break/disable a macro when opening a workbook Niklas Excel Programming 4 June 30th 04 10:07 PM
Disable the opening of another workbook DDLY Excel Programming 1 November 26th 03 07:52 PM


All times are GMT +1. The time now is 01:13 PM.

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"