![]() |
SaveAs
I have the following code:
FName = Application.GetSaveAsFilename(InitFileName, "Excel File (*.xls),*.xls") ActiveWorkbook.SaveAs FName, CreateBackup = False When I cancel the save, I get a "FALSE" file. I believe this is a backup file so I set Createbackup = false. But no luck. Thanks in advance. -- Thanks! |
SaveAs
If you cancel Application.GetSaveAsFilename the it returns "FALSE". You need
to check for this before saving FName = Application.GetSaveAsFilename(InitFileName, "Excel File (*.xls),*.xls") if FName < "FALSE then ActiveWorkbook.SaveAs FName, CreateBackup = False end if -- HTH... Jim Thomlinson "Daviv" wrote: I have the following code: FName = Application.GetSaveAsFilename(InitFileName, "Excel File (*.xls),*.xls") ActiveWorkbook.SaveAs FName, CreateBackup = False When I cancel the save, I get a "FALSE" file. I believe this is a backup file so I set Createbackup = false. But no luck. Thanks in advance. -- Thanks! |
SaveAs
Declare FName as a Variant and test it for False (not "False"). E.g.,
Dim FName As Variant FName = Application.GetSaveAsFilename(....) If FName = False Then Debug.Print "User Cancelled" Else Debug.Print "Filename: " & FName End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Daviv" wrote in message ... I have the following code: FName = Application.GetSaveAsFilename(InitFileName, "Excel File (*.xls),*.xls") ActiveWorkbook.SaveAs FName, CreateBackup = False When I cancel the save, I get a "FALSE" file. I believe this is a backup file so I set Createbackup = false. But no luck. Thanks in advance. -- Thanks! |
All times are GMT +1. The time now is 01:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com