Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
save workbook as different name
Hi all,
I need to be able to save the active workbook by including the name which appears in a combo box on the users sheet into the file Path/Name. I can save the file by having a complete Path/Name but need to be able to concatenate the selection with the given path. The following code returns an 'object required' error. Can anyone help? D Sub SaveFile() Dim fs As Object Dim strFile As String Dim strNewFile As String Dim FilePath As String Set FilePath = ("\\Blah Blah Blah\") strFile = ThisWorkbook.Name strNewFile = "\\Blah Blah Blah\" & cboxProjectList.Value & "\.xls" Set fs = CreateObject("Scripting.FileSystemObject") fs.CopyFile strFile, strNewFile MsgBox "Your file has been saved" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
save workbook as different name
Hi Damien
Try using application.ActiveWorkbook.SaveAs filename, fileformat etc. etc. see help and exmaple for SaveAs HTH KM "Damien" wrote: Hi all, I need to be able to save the active workbook by including the name which appears in a combo box on the users sheet into the file Path/Name. I can save the file by having a complete Path/Name but need to be able to concatenate the selection with the given path. The following code returns an 'object required' error. Can anyone help? D Sub SaveFile() Dim fs As Object Dim strFile As String Dim strNewFile As String Dim FilePath As String Set FilePath = ("\\Blah Blah Blah\") strFile = ThisWorkbook.Name strNewFile = "\\Blah Blah Blah\" & cboxProjectList.Value & "\.xls" Set fs = CreateObject("Scripting.FileSystemObject") fs.CopyFile strFile, strNewFile MsgBox "Your file has been saved" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Shared workbook - to save or not to save | Excel Discussion (Misc queries) | |||
Save column J of WorkBook when WorkBook is not saved. | Excel Programming | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Using interop.excel to open a workbook, the workbook doesn't ask to save changes. | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |