J
J@Y
I have the following script for adding a workbook. What error handling can I
add so that it tells the user the file name they try to create already exists
and is open. Then exits the program. I would liek to use a more specific
method than "On error goto ErrHandle"
Set ReportBook = Workbooks.Add()
Set ReportPage = Worksheets.Add
ReportPage.Name = "Report"
Do
fName = Application.GetSaveAsFilename(Title:="Specify Report Name")
Loop Until fName <> False
If UCase(Right(fName, 4)) <> ".XLS" Then fName = fName + "xls"
ReportBook.SaveAs Filename:=fName
add so that it tells the user the file name they try to create already exists
and is open. Then exits the program. I would liek to use a more specific
method than "On error goto ErrHandle"
Set ReportBook = Workbooks.Add()
Set ReportPage = Worksheets.Add
ReportPage.Name = "Report"
Do
fName = Application.GetSaveAsFilename(Title:="Specify Report Name")
Loop Until fName <> False
If UCase(Right(fName, 4)) <> ".XLS" Then fName = fName + "xls"
ReportBook.SaveAs Filename:=fName