Problem with my SaveAs code ?

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,047
I want this macro to save my activeworkbook in a different location, adding todays date to it
and I have done the following

Sub Saves()

Dim wbo As Workbook
Dim mydate As Date

Set wbo = ActiveWorkbook

mydate = Format(Date, "dd-mmm-yy")

fn = "Report 3 Template " & mydate & ".xls"

fp = "\\Tfcluster-vol1\vol1\DEPART\GROUND\123 FILES\6. RESERVATIONS - Outstanding requests\2.Saved 03 Reports Files\"

wbo.SaveAs Filename:=fp & fn

wbo.Close savechanges:=False


End Sub



It errors at the point which says "wbo.SaveAs Filename:=fp & fn"

because it says the file name does not exist (well it shouldn't) or because the file is in use by another program.....very unlikely ?!!?

Can anyone see any problems with what I have written please

Regards
Paul
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I'm not entirely sure what I do now if no one knows the answer to this question ...any guidance on who I can go to ?
 
Upvote 0
Being honest I managed to save a new file to my desktop with just

Code:
ActiveWorkbook.SaveAs Filename:= _
"pathname" & "filename " & Format(Now, "dd-mm-yy") _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

Obviously change the path, file format and file name to suit
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,863
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top