Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Excel keeps asking for save when user closes system with "Macros Disabled" logic

Hi All

I have implemented the approach to (try to) ensure macros are enabled
discussed in this group.

This is working fine for me apart from when the user attempts to close
the workbook

To summarise my implementation of Workbook_BeforeSave :
- I reveal the "Macros Disabled" sheet
- I hide all the other sheets
- I disable events and then perform the save myself
- I then try and tell Excel that I have done the save so dont
save again with:
Me.Saved = True
Cancel = True ' the Cancel paramter from the
Workbook_BeforeSave call
- I then reveal all the sheets again and hide the "Macros
Disabled" sheet so the user is none the wiser and they can then
continue to work on the file

The problem happens when the user wants to close the workbook:
* if they click save then close - no problem
* if they click close first in order to provoke a "Save" popup
dialog (a lot of users use this approach it seems) then click "Yes"
the save happens and my logic runs but then Excel keeps looping with
the "Save" popup until the user clicks "No" rather than "Yes". This
behaviour confuses my users *big* time.

Does anyone have any idea of why Excel still thinks a save is
required? I thought I could get around this with:
Me.Saved = True
Cancel = True ' the Cancel paramter from the
Workbook_BeforeSave call
but this does not seem to be the case in the second scenario explained
above.

Cheers for any ideas. Please feel free to point out any alternative
implementations.

Chrisso

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
"excel "macros may be disabled" message using an xlam file frustrated Excel Worksheet Functions 2 July 13th 09 08:32 PM
Excel 2003 closes file on "save as" Patt Excel Discussion (Misc queries) 1 October 22nd 08 12:59 PM
"Data Connections have been disabled" If no macros, Why? [email protected] Excel Discussion (Misc queries) 1 October 13th 07 01:26 AM
User form closes after opening another one -- Problem with "Unload Me"? [email protected] Excel Programming 2 January 8th 07 05:52 AM
error "macros disabled, refer to online help?" emmy128 Excel Programming 1 September 13th 06 07:07 PM


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