Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Prevent disabling of macros?

Dear All

Does anyone know how to prevent a workbook from opening if the user
chooses to disable macros? (eg they have the Security Level set to
'high').

I want to use code to provide certain protections to spreadsheets (for
example, to ensure that users can't copy and paste data). But if the
user opens without enabling macros, they can bypass these extra
protections.

I have thought of one way:
Upon saving, hide all sheets except for one sheet with a message on it
"In order to use this spreadsheet, you must enable macros". Upon
opening, code unhides the other spreadsheets and hides the first sheet.
When combined with Protect Workbook Structure this works, kind of.
But it's pretty clumsy and looks a bit confusing to the user (they get
a brief period of time to read the first sheet when the book loads).

Cheers
Richard

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Prevent disabling of macros?

Richard,
That's the only way.
You have to leave the WB in such a state (using the _BeforeSave and/or _
BeforeClose) that if macro are NOT enabled, the user sees only the advice
sheet and cannot interact with the other sheets.
If you could interact with the Macro Security settings, then any virus
writer could also.

NickHK

wrote in message
oups.com...
Dear All

Does anyone know how to prevent a workbook from opening if the user
chooses to disable macros? (eg they have the Security Level set to
'high').

I want to use code to provide certain protections to spreadsheets (for
example, to ensure that users can't copy and paste data). But if the
user opens without enabling macros, they can bypass these extra
protections.

I have thought of one way:
Upon saving, hide all sheets except for one sheet with a message on it
"In order to use this spreadsheet, you must enable macros". Upon
opening, code unhides the other spreadsheets and hides the first sheet.
When combined with Protect Workbook Structure this works, kind of.
But it's pretty clumsy and looks a bit confusing to the user (they get
a brief period of time to read the first sheet when the book loads).

Cheers
Richard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Prevent disabling of macros?

Richard

I faced a similar issue, that the 'cover sheet' which advises those with
macros disabled is visible to users with macros enabled, before the macro
runs and hides it. It is intrusive, and I searched unsuccessfully for ways to
delay it displaying until the macro kicked in. In the end I formatted the
cover sheet as a graphic about 75 mm by 60 mm in the centre of the sheet so
that it looks like the kind of splash screen that first displays when you run
proprietary software (complete with version and publication details). This
looked more professional and users didn't notice the intrusion.

Regards

" wrote:

Dear All

Does anyone know how to prevent a workbook from opening if the user
chooses to disable macros? (eg they have the Security Level set to
'high').

I want to use code to provide certain protections to spreadsheets (for
example, to ensure that users can't copy and paste data). But if the
user opens without enabling macros, they can bypass these extra
protections.

I have thought of one way:
Upon saving, hide all sheets except for one sheet with a message on it
"In order to use this spreadsheet, you must enable macros". Upon
opening, code unhides the other spreadsheets and hides the first sheet.
When combined with Protect Workbook Structure this works, kind of.
But it's pretty clumsy and looks a bit confusing to the user (they get
a brief period of time to read the first sheet when the book loads).

Cheers
Richard


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Prevent disabling of macros?

Hi Kasama

Thanks for that tip, that's a really good idea, I'll give it a try!!

Cheers
Richard

Kasama wrote:
Richard

I faced a similar issue, that the 'cover sheet' which advises those with
macros disabled is visible to users with macros enabled, before the macro
runs and hides it. It is intrusive, and I searched unsuccessfully for ways to
delay it displaying until the macro kicked in. In the end I formatted the
cover sheet as a graphic about 75 mm by 60 mm in the centre of the sheet so
that it looks like the kind of splash screen that first displays when you run
proprietary software (complete with version and publication details). This
looked more professional and users didn't notice the intrusion.

Regards

" wrote:

Dear All

Does anyone know how to prevent a workbook from opening if the user
chooses to disable macros? (eg they have the Security Level set to
'high').

I want to use code to provide certain protections to spreadsheets (for
example, to ensure that users can't copy and paste data). But if the
user opens without enabling macros, they can bypass these extra
protections.

I have thought of one way:
Upon saving, hide all sheets except for one sheet with a message on it
"In order to use this spreadsheet, you must enable macros". Upon
opening, code unhides the other spreadsheets and hides the first sheet.
When combined with Protect Workbook Structure this works, kind of.
But it's pretty clumsy and looks a bit confusing to the user (they get
a brief period of time to read the first sheet when the book loads).

Cheers
Richard



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
Disabling macros EllenM Excel Discussion (Misc queries) 1 February 26th 08 04:57 PM
Disabling Macros Brian Matlack[_15_] Excel Programming 0 October 21st 05 01:21 PM
Disabling Macros Greg Excel Programming 2 February 24th 05 05:06 PM
Prevent user disabling events JP Farrow Excel Programming 1 September 29th 04 04:49 PM
Prevent user from disabling macros Michael Monteiro Excel Programming 0 August 21st 03 04:28 AM


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

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"