![]() |
save conunderum
how can i put
cancel = true in the Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) section of the source code when ever i do, it won't save the changes. I searched in the old records and found a reference to www.cpearson.com/excel/vbe.htm but this is either too complicated for a 'newbie' like me or it won't work. If any one can help, please do. I'm tearing what little hair i do have, out. |
save conunderum
Hi
what are you trying to achieve? Some workarounds: After inserting this line in your code type the following in the Immediate window: application.enebleevents=false now save the workbook after this enter the following in the immediate window application.enebleevents=True -----Original Message----- how can i put cancel = true in the Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) section of the source code when ever i do, it won't save the changes. I searched in the old records and found a reference to www.cpearson.com/excel/vbe.htm but this is either too complicated for a 'newbie' like me or it won't work. If any one can help, please do. I'm tearing what little hair i do have, out. . |
save conunderum
Hi,
ted daniels wrote: how can i put cancel = true in the Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) section of the source code when ever i do, it won't save the changes. I searched in the old records and found a reference to www.cpearson.com/excel/vbe.htm but this is either too complicated for a 'newbie' like me or it won't work. If any one can help, please do. I'm tearing what little hair i do have, out. for example: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean) If SaveAsUI Then MsgBox "User want to 'Save as' the File" ' only 'Save as' will be canceled Cancel = True Else MsgBox "User want to 'save' the file" ' only 'Save' will be canceled Cancel = True End If 'Save' and 'Save as' will be canceled Cancel = True End Sub -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
save conunderum
Spelling error, change to:
application.enableevents=false This is language specific to Weevils and won't work in the English version: application.enebleevents=false Toby Erkson Oregon, USA On Thu, 22 Apr 2004 08:49:55 -0700, "Frank Kabel" wrote: Hi what are you trying to achieve? Some workarounds: After inserting this line in your code type the following in the Immediate window: application.enebleevents=false now save the workbook after this enter the following in the immediate window application.enebleevents=True -----Original Message----- how can i put cancel = true in the Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) section of the source code when ever i do, it won't save the changes. I searched in the old records and found a reference to www.cpearson.com/excel/vbe.htm but this is either too complicated for a 'newbie' like me or it won't work. If any one can help, please do. I'm tearing what little hair i do have, out. . |
All times are GMT +1. The time now is 12:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com