Save As Function

G

Guest

I am trying to create code that will save a workbook based on a date in a
cell on a sheet within the workbook. I have started the code but VB doesn't
like it. See below:
ActiveWorkbook.Save
Sheets("Schedule").Select
ActiveWorkbook.SaveAs Filename:= _
"T:\Period End Schedules\Inventory Account Schedules\Inventory
Obsolescence\Schedule\" & Month("A2") & "/" & Day("A2") & "/" & Year("A2") &
".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="Password", _
ReadOnlyRecommended:=False, CreateBackup:=True

End Sub

The problem I am having is that the code bombs at the SaveAs command. How
do I get around this?
 
H

Helmut Weber

Hi,

a slash "/" is not a valid character in a filename.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top