Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need help with BeforeSave event
Hi,
I have code in the BeforeSave to 'suggest' a filename to save as but the user needs to be able to change the 'suggestion' before saving. I'm using Application.GetSaveAsFilename to suggest the filename. When ThisWorkbook.SaveAs SaveAsFileName is executed, it fires the BeforeSave event again. Is there anyway a better way to do what I'm attempting here? If SaveAsUI = True Then ' displays SaveAs dialog box with default filename. Returns SaveAsFileName SaveAsFileName = Application.GetSaveAsFilename(PMFileName, "Microsoft Office Excel Workbook (*.xls), *.xls") ' if user clicked Cancel then SaveAsFileName = False If SaveAsFileName = "False" Then Cancel = True Exit Sub Else ThisWorkbook.SaveAs SaveAsFileName Cancel = True End If End If -- Thanks in advance! Chuck M. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trying to run macro on the BeforeSave event | Excel Programming | |||
BeforeSave Event Question | Excel Programming | |||
BeforeSave event | Excel Discussion (Misc queries) | |||
BeforeSave event | Excel Programming | |||
BeforeSave workbook event | Excel Programming |