View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NADavies NADavies is offline
external usenet poster
 
Posts: 1
Default Checking if file exists in VBA

My issue is with Exel 2000, more used to Access than Exel
so bear with me!

Have the following simple code to save a spreadsheet which
works fine as long as the file name being saved to doesn't
already exist.

ActiveWorkbook.SaveAs Filename:= "C:\Test.XLS", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

Really need to handle this gracefully and not just return
an error code to the user.

Any help would be appreaciated.

Regards

Nigel