Thread: [Solved] SaveCopyAs
View Single Post
 
Old 11-01-2011, 07:25 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default SaveCopyAs

I'm using Excel and create a button that runs the assigned macro:

Code:
ActiveWorkbook.SaveCopyAs "C:\" & Range("B2").Value & ".xls", FileFormat:=56
But this one just saves/overwrites the file itself.

Another one that just forces users to save the file; if not, cannot exit the window:

Code:
Sub forceSaveAs()

Dim NewBook
Dim fName

Set NewBook = Workbooks.Add
Do
    fName = Application.GetSaveAsFilename
Loop Until fName <> False
NewBook.saveAs Filename:=fName

End Sub
Is it a better way or how can I use SaveCopyAs to do so?
Reply With Quote