Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Close Workbook if Macros not enabled

Hi Group
Is it possible to close a workbook if the user does not enable macros. If
so, how would this be achieved? Any help would be very much appreciated as
it is important that my user cannot bypass enableing macros.
Many thanks
Graham


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Close Workbook if Macros not enabled

It's not possible, since macros would have to be enabled to automate
closure.

What is often suggested is to have all sheets hidden except a "splash"
sheet, saying "you must enable macros to use this workbook." You could
then use a Workbook_Open() event to unhide the working sheets and hide
the splash sheet. Use a Workbook_BeforeSave macro to unhide the splash
sheet, hide the working sheets, save the file, then reverse the process
again. You can set the visibility of the working sheets to xlVeryHidden
to prevent them from being listed in the Format/Sheet/Unhide dialog.

Note that this will only be a convenience to your users, not provide any
real security. Anyone with enough ability to find these newsgroups will
be able to find ways to bypass your protection scheme.





In article ,
"Graham Fowler" wrote:

Is it possible to close a workbook if the user does not enable macros. If
so, how would this be achieved? Any help would be very much appreciated as
it is important that my user cannot bypass enableing macros.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Close Workbook if Macros not enabled

protect the Splash Sheet which tells the user that macros must be enabled &
Set other Sheets to xlSheetVeryHidden
then try this macro...

Private Sub Workbook_Open()
' this activates if macro's Enabled..!
' otherwise only splash screen Visible
For Each sh In Sheets
sh.Visible = True
Next sh
Sheets("Sheet1").Visible = xlVeryHidden ' Hide Splash Sheet if macro's
Enabled
End Sub


HTH
Andrew

"Graham Fowler" wrote in message
...
| Hi Group
| Is it possible to close a workbook if the user does not enable macros. If
| so, how would this be achieved? Any help would be very much appreciated as
| it is important that my user cannot bypass enableing macros.
| Many thanks
| Graham
|
|


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
how to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:16 PM
how to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:15 PM
Macros on workbook close and save Ade P Excel Programming 1 May 2nd 05 11:39 AM
Close a workbook without saving macros Papa Jonah Excel Programming 12 October 27th 04 12:43 AM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM


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