Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetSaveAsFilename Question
If the user enters a filename already in the directory, how can I
prevent the error 1004 message The code prevent that ? -- Regards Ron De Bruin http://www.rondebruin.nl "kev_06" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with getsaveasfilename | Excel Discussion (Misc queries) | |||
a question about "Application.GetSaveAsFileName" | Excel Programming | |||
Help with GetSaveAsFilename | Excel Programming | |||
GetSaveAsFileName | Excel Programming | |||
After GetSaveAsFileName question | Excel Programming |