Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I learned in this newsgroup to use the BeforeSave event to force the user to do specific things when he wants to save the workbook. Well, this works great. But sometimes I get an error I can't avoid. If the filename already exists I get the question whether I want to replace the file. If I decide not to replace the file and choose the button 'No' or 'Cancel' then I get the run- time error '1004'. Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) fname = Application.GetSaveAsFilename Application.EnableEvents = False ActiveWorkbook.SaveAs Filename:=fname Application.EnableEvents = True End Sub Can anybody give me some hint? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.EnableEvents | Excel Worksheet Functions | |||
application.EnableEvents | Excel Discussion (Misc queries) | |||
object.EnableEvents = false | Excel Programming | |||
application.enableEvents | Excel Programming | |||
Application.EnableEvents | Excel Programming |