LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Disable Macros when opening workbook


I am looking for an answer to the original question.

I have a worksheet containing a list of hundreds of users' workbooks on
a number of network servers. I want to identify which contain VBA code
and which don't. Later it will be my job to test that they run in our
new company environment (Office 97 - Office XP; Windows 2000 -
Windows XP). This is only the first of such lists, and will be
looking at potentially thousands of workbooks over the next couple of
months.

Rather than open them all up manually, I wrote a simple procedure to
scan through the list of paths, open each workbook, sum up the
CountOfLines in each CodeModule, then close the workbook. I will run
this overnight, and come back tomorrow and focus on the workbooks that
contain vba code.

I do not want to execute macros when I open each workbook.
OK... Solution : turn off events as suggested above

This worked fine, until my application started opening workbooks with
references to some obscure fiancial libraries that some users have
installed that I don't have. The Workbook_Open doesn't run, but Excel
still tries to COMPILE the code. The compilation fails, shows me the
errant line of code in the user's workbook. Neither disable events nor
disable alerts stops this. I really want to disable macros completely
when I open up each workbook. But I still want to be able to count how
many lines of code....


--
ScottDK
------------------------------------------------------------------------
ScottDK's Profile: http://www.excelforum.com/member.php...o&userid=16393
View this thread: http://www.excelforum.com/showthread...hreadid=248696



 
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 macros on a programmatically opening .xls file Matt[_2_] Excel Discussion (Misc queries) 2 May 25th 07 04:45 AM
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
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM
Opening a workbook containing macros from VB Brian Walters Excel Programming 2 August 6th 03 10:20 PM


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

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"