Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using a macro to save an XLS however if the file already exists you are
promted, as normal, if you want to replace the file or not (Yes or No). If I choose "No" I just want to exit the macro however I am prompted with "Continue, End or Debug". How can I just exit from this macro gracefully? Turning "Display Alerts" off is not an option, although it works. My code follows... Sub SaveXLS() If Range("A1").Value = "" Then MsgBox ("Cell A1 must have an entry.") Else SaveAsFile = ThisWorkbook.Worksheets("Sheet1").Range("A1") ChDir "E:\Fun With Excel" 'It is at this next process I have my issue... ActiveWorkbook.SaveAs Filename:= _ "E:\Fun With Excel\Playing With Excel (" & SaveAsFile & ").xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Restrict Prompting for Macro Security | Excel Programming | |||
Excel Macro Prompting | Excel Programming | |||
Macro Examples for prompting info | Excel Programming | |||
Prompting 'Save As' in an Excel Macro | Excel Programming | |||
Prompting a macro to run on change of cell content | Excel Programming |