Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code that saves a file with a set name and
path using the ActiveWorkbook.SaveAs method. When the file already exists, the user is prompted about whether to write over the file. If the user answers 'No' or 'Cancel', an error (#1004) occurs. My error handler hasn't been able to trap this error for some reason. Is there a quick way to get Excel to prompt for another file name and then continue processing the remaining code? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You could use Application.DisplayAlerts = False ActiveWorkbook.SaveAs ("Test saveas.xls") Application.DisplayAlerts = True which will force an overwrite. If you don't want to do that for fear of overwriting a different existing file, you could use Excel.Application.Dialogs(xlDialogSaveAs).Show where you can change the saveas name or cancel without the error. HTH KenM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Suddenly Save and Save as greyed out in Excel 2003 | Excel Discussion (Misc queries) | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
'document not saved' for 'save' or 'save as' an EXCEL file | Excel Discussion (Misc queries) | |||
Save & Save As features in file menu of Excel | Excel Discussion (Misc queries) | |||
Save Excel file - prompts to save - no Volitile functions used | Excel Worksheet Functions |