Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
Happy New Year - belated but well meant :) I'm programmatically using the SaveAs Dialog Box to allow the user to decide where to save a file. If the chosen path already exists, SaveAs points this out. Fine, except that, if the option to not overwrite the file is chosen, an error 1004 message appears. Clicking Help helpfully displays a blank Help screen. In short, how do I handle this error. Code example as follows. Sub UserFileSave() Dim Fname, Suggestion, Hdr Suggestion = "MyFile " & Format(Date, "dd mmm yy") Hdr = "Please choose a Location and Name then click Save." Fname = Application.GetSaveAsFilename(Suggestion, fileFilter:="Excel File (*.xls), *.xls)", Title:=Hdr) If Fname = False Then 'Handle Cancel UserCancel Else ThisWorkbook.SaveAs FileName:=Fname End If End Sub Regards, Don ( XL97 Win98 / XL2003 WinXp ) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem using SaveAs method | Excel Discussion (Misc queries) | |||
ActiveWorkbook.SaveAs Problem | Excel Programming | |||
SaveAS w/ a variable name problem | Excel Programming | |||
SaveAs problem | Excel Programming | |||
SaveAs problem, renames Worksheet too | Excel Programming |