Hi
I wish to save a macro enabled template file to a macro enabled file in D:\Invoice\2012\ with a file name equivalent to the value of cell k3 in sheet 1.
I tried the following macro but ended up with a error
Sub saveFileMacro()
FullFileName = Application.GetSaveAsFilename("D:\Invoice\2012\" & Format(Range("K3").Value) & ".xlsm", _
"Excel Macro-Enabled Workbook (*.xlsm),*.xlsm", 2, "Save File As")
If FullFileName <> vbNullString Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
FullFileName, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWorkbook.Close
Else
MsgBox "File not saved"
End If
End Sub
It works only till the "save as" screen and once I press save, it shows error "Runtime error '1004'. This extension cannot be used with selected file type and so on..
Originally I got this macro from http://www.excelforum.com/excel-prog...-template.html, customized it a little based on my requirement but still ended up with an error.
A little help would be much appreciated.
Thanks
Anand
Bookmarks