|
-
December 1st, 1999, 10:28 AM
#1
Saving an Excel Sheet
I am making use of Excel's automation and I use the Excel worksheet method of SaveAs. If the path and name of the file already exists I get the option to either overwrite the existing file, not overwrite, ot cancel. What I need is a way to have the option that if there is an existing file, then be able to input a new name, is there a Excel method that does that?
-
December 1st, 1999, 10:53 AM
#2
Re: Saving an Excel Sheet
since you use automation (probably from VB), you can use VB to check for the existence of the file as in
Dim strfile as string
strfile = "c:\x.xls"
If Dir(strfile) <> "" then
x.Visible = true
x.WindowState = xlNormal
strfile = x.GetSaveAsFilename(strfile)
End If
x.ActiveWorkbook.SaveAs FileName:=strfile, ConflictResolution:=xlUserResolution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|