Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Workbook opened with macros disabled

Having got past the issue of users using CTRL+Break to
stop a macro, a colleague has pointed out that users may
open a workbook with "Macros disabled".

This presents me with a conundrum...........

If the workbook is opened with macros disabled, I want to
prevent any data entry from taking place, but if the
macros are disabled, I can't use the worksheet change
event to inform the user..

The only solution I could think of is:

1. Identify all the cells which are unlocked for data
entry (all the rest are locked), and set them to "locked".

2. Write a procedure that "unlocks" these cells if the
parameter is set to an agreed value.

3. Set the parameter to the agreed value if the auto_open
macro has been successfully completed - thereby unlocking
the data entry cells.

This would stop any data entry if the workbook was opened
and the macros were disabled.

BUT, does anyone have any better solutions to this ?

I am presently on Windows NT with Excel 97.

Thanks

Alan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Workbook opened with macros disabled

Hi
I use a quite similar approach
1. Create a worksheet with a message like 'Macros have to
be enabled'
2. Hide all other sheets (with xlsheetveryhidden)
3. In the AutoOpen macro hide sheet 1 and unhide all other
sheets
4. In the Beforeclose event hide all sheets and unhide
sheet 1 + save the workbook



-----Original Message-----
Having got past the issue of users using CTRL+Break to
stop a macro, a colleague has pointed out that users may
open a workbook with "Macros disabled".

This presents me with a conundrum...........

If the workbook is opened with macros disabled, I want to
prevent any data entry from taking place, but if the
macros are disabled, I can't use the worksheet change
event to inform the user..

The only solution I could think of is:

1. Identify all the cells which are unlocked for data
entry (all the rest are locked), and set them to "locked".

2. Write a procedure that "unlocks" these cells if the
parameter is set to an agreed value.

3. Set the parameter to the agreed value if the auto_open
macro has been successfully completed - thereby unlocking
the data entry cells.

This would stop any data entry if the workbook was opened
and the macros were disabled.

BUT, does anyone have any better solutions to this ?

I am presently on Windows NT with Excel 97.

Thanks

Alan
.

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
Macros are disabled . . . and they shouldn't be pglufkin Excel Discussion (Misc queries) 3 January 2nd 07 06:38 PM
Macros are disabled cgore Excel Discussion (Misc queries) 1 February 17th 06 05:33 PM
Excel crashes when attempting to open workbook...even with macros disabled llowwelll[_10_] Excel Programming 1 May 24th 04 09:38 PM
macros disabled John Wilson Excel Programming 1 September 8th 03 04:35 PM
macros disabled Dan E[_2_] Excel Programming 0 September 8th 03 04:01 PM


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