LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default BeforeSave, Cancel and ReadOnly

Hello

I am using the BeforeSave event to replace the normal save action with one
that determines changed data and writes it to a database. The basic structure
is as follows:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "This would be the custom save action"
Cancel = True
End Sub

This works fine except when the workbook is read-only, which I require to
prevent users from messing around with the xls file, deleting it accidently
or whatever. Then it displays the message:

'savetest.xls' is read-only. To save a copy, click OK, then give the
workbook a new name in the Save As dialog box.

and continues as it should do with the custom action.

How do I get it to stop displaying that message box? It's entirely useless in
this case and just confuses people.

Thanks
Steve

 
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
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work gpmichal Setting up and Configuration of Excel 1 May 12th 09 02:33 AM
Input box to cancel sub when Cancel is clicked. PCLIVE Excel Programming 5 September 5th 06 03:19 PM
Disabling 'Cancel' option when saving work (Yes/No/Cancel) [email protected] Excel Programming 0 July 11th 06 09:28 PM
How to use Excel VBA to cancel Excel readonly status kobeting Excel Programming 2 March 17th 06 06:03 PM
Cancel Macro is user selects 'cancel' at save menu Mark Excel Programming 1 April 6th 05 05:45 PM


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