View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kev_06[_6_] kev_06[_6_] is offline
external usenet poster
 
Posts: 1
Default GetSaveAsFilename Question


Using the following code:

Sub Test()
Dim fname As Variant
Dim Wb As Workbook
Set Wb = ActiveWorkbook

Again:
fname = Application.GetSaveAsFilename("", _
fileFilter:="Excel Files (*.xls), *.xls")
'On Error Resume Next
If fname = False Then Exit Sub
If Dir(fname) < "" Then GoTo Again
Wb.SaveAs fname
End Sub

If the user enters a filename already in the directory, how can I
prevent the error 1004 message? (If the user does not want to overwrite
the file and selects 'no', the error 1004 message appears)


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=548709