Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Disable "On Open" macro

Our cost centers have a workbook (ProcessData) with a number of macros in it.

The code for one of the macros is contained in a "Workbook Open" sub. This
code does a number of things depending on what it finds when the workbook
(ProcessData) is opened each time. A msgbox may be displayed for the user.
If a msgbox is displayed, a second macro kicks off when the user presses "OK".

When the user is finished updating their data, there is another macro in
this same workbook (ProcessData) that is used to (1) make a copy of their
workbook (ProcessData) and (2) place a copy on a shared network drive.

I have a macro to open each copy and extract the data. The problem I'm
having is the "Workbook Open" sub runs each time one of the copies is opened.
If the msgbox is displayed, the my macro stops until I click "OK".

The msgbox is only important to the cost centers and is not needed for the
macro I am running.

My question is: is it possible to disable the macros contained in the
submitted copies so the msgbox is never displayed. I only need to extract
the data on these copies, I do not want to let the second macro kick off.

Below is the line of code, I'm using to open the submitted files:

Workbooks.Open (MyPath & MyFile)

Thanks for the help........

----
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Disable "On Open" macro

Open the secondary workbooks in Office Safe Mode. For example:

Sub is_it_safe()
Dim s As String
Dim s2 As String
s2 = "C:\temp\child1.xls /s"
s = "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe "
x = Shell(s & s2, 1)
End Sub


--
Gary''s Student - gsnu200800


"JT" wrote:

Our cost centers have a workbook (ProcessData) with a number of macros in it.

The code for one of the macros is contained in a "Workbook Open" sub. This
code does a number of things depending on what it finds when the workbook
(ProcessData) is opened each time. A msgbox may be displayed for the user.
If a msgbox is displayed, a second macro kicks off when the user presses "OK".

When the user is finished updating their data, there is another macro in
this same workbook (ProcessData) that is used to (1) make a copy of their
workbook (ProcessData) and (2) place a copy on a shared network drive.

I have a macro to open each copy and extract the data. The problem I'm
having is the "Workbook Open" sub runs each time one of the copies is opened.
If the msgbox is displayed, the my macro stops until I click "OK".

The msgbox is only important to the cost centers and is not needed for the
macro I am running.

My question is: is it possible to disable the macros contained in the
submitted copies so the msgbox is never displayed. I only need to extract
the data on these copies, I do not want to let the second macro kick off.

Below is the line of code, I'm using to open the submitted files:

Workbooks.Open (MyPath & MyFile)

Thanks for the help........

----
JT

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
Disable autoformat of "true" and "false" text drs207 Excel Discussion (Misc queries) 6 April 14th 23 05:33 PM
how can I disable "cutting cells" and "drag and drop "in excel ? mwoody Excel Worksheet Functions 4 August 25th 08 03:53 PM
How to disable "New" "open" menu items in Excel 2007 Aruna Akella Excel Programming 1 March 26th 08 05:13 AM
Disable all "Refresh Data on File open" SupperDuck Excel Programming 2 June 10th 06 02:41 PM
Suppress "Disable/Enable Macros" and Query Refresh dialog on open Sharon Excel Programming 2 January 18th 06 09:20 PM


All times are GMT +1. The time now is 12:06 PM.

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

About Us

"It's about Microsoft Excel"