Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Disabling macros with Shift+[OPEN]

Is there a way to prevent a user from disabling VBA macros
by holding SHIFT when clicking the OPEN button?
I'm using Excel 2000.

Thanks,

Brian.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Disabling macros with Shift+[OPEN]

I do it as follows:

Name a cell in worksheet "X" as (say) AutoOpenExecuted.
Add a Workbook_Open procedure (you probably have one
already) and, at the end of it, insert

Sheets("X").Range("AutoOpenExecuted").Value = True

Also add a Workbook_BeforeSave procedure and include in it:

Sheets("X").Range("AutoOpenExecuted").value = False

In a frequently-used procedure, such as one you call at
the beginning of other procedures to perform housekeeping
tasks, or the Class_Initialize procedure for a frequently-
used class, insert:

If Sheets("X").Range("AutOpenExecuted") = False then _
MsgBox "Don't hold shift key when opening workbook"
Thisworkbook.Close SaveChanges:=False

The trick is to find the right place (or places) to check
if the cell is True or False.


-----Original Message-----
Is there a way to prevent a user from disabling VBA

macros
by holding SHIFT when clicking the OPEN button?
I'm using Excel 2000.

Thanks,

Brian.
.

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
Does Disabling Macros affect Hyperlinks Joe Mac Excel Discussion (Misc queries) 1 August 26th 09 07:00 PM
Disabling macros EllenM Excel Discussion (Misc queries) 1 February 26th 08 04:57 PM
Prevent user from disabling macros Michael Monteiro Excel Programming 0 August 21st 03 04:28 AM
Enabling/Disabling Macros David Excel Programming 6 August 12th 03 06:21 PM
Open Method disabling Macros Bryan Steffen Excel Programming 0 July 16th 03 01:34 PM


All times are GMT +1. The time now is 06:22 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"