PC Review


Reply
Thread Tools Rate Thread

Disable "On Open" macro

 
 
JT
Guest
Posts: n/a
 
      15th Aug 2008
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 With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      15th Aug 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I disable Outlook warning from Excel macro "Send" method wpiet Microsoft Outlook VBA Programming 14 7th Jan 2009 12:54 PM
How to disable "New" "open" menu items in Excel 2007 Aruna Akella Microsoft Excel Programming 1 26th Mar 2008 05:13 AM
Possible to change default "All Open Workbooks" to "This Workbook" in macro dialogue box? StargateFanFromWork Microsoft Excel Discussion 0 4th Jan 2006 10:49 PM
Here's a macro that will globallly disable annoying "Show in Groups" feature andreas gammel Microsoft Outlook VBA Programming 0 9th Jun 2004 09:11 AM
How to restrict / disable "File", "Edit" and "View"-Menu?? =?Utf-8?B?bWFya3VzMzU0?= Windows XP Internet Explorer 2 4th Jun 2004 09:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 AM.