wmcnabb084
New Member
- Joined
- Sep 23, 2010
- Messages
- 9
I am trying to use a cell reference to have excel automatically Save a worksheet using a cell reference as the workbook name. When I step through the code and use the immediate window I get the correct name for the file (fname in this case) but as soon as Excel tries to save the file, I get an error.
Here is the code I am using:
fname = Sheet3.Range("I1").Value
ChDir "S:\Op Costs\Budget 2013\Data"
MsgBox "The actice file will be saved as " & fname
ActiveWorkbook.SaveAs filename:= _
"S:\Op Costs\Budget 2013\Data\" & fname & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Any help would be most appreciated...
Here is the code I am using:
fname = Sheet3.Range("I1").Value
ChDir "S:\Op Costs\Budget 2013\Data"
MsgBox "The actice file will be saved as " & fname
ActiveWorkbook.SaveAs filename:= _
"S:\Op Costs\Budget 2013\Data\" & fname & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Any help would be most appreciated...