#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs - VBA Jae[_3_] Excel Discussion (Misc queries) 4 April 10th 08 08:10 PM
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
SaveAs Duncan[_6_] Excel Programming 1 June 15th 06 09:52 AM
SaveAs Dave Peterson[_3_] Excel Programming 1 September 12th 03 12:44 AM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"