S
sakung
i'm new in VBE and need some advice on my work. I would like to sav
invoice to another name and print that new workbook and then close i
by using macro.
On my code, run the Save As command to create a new copy
of the Workbook(pentagon0002.xls), then don't open up that workbook
just close it.
that will give me the error "Object Required". What else I need t
fix?
Sub SaveandPrintout()
ActiveWindows.SelectSheets.PrintOut Copies:=1, Collate:=True
FileNum = ThisWorkbook.Sheets("Invoice").[B2].Value
FileNumStr = Format(FileNum, "0000")
ActiveWorkbook.SaveAs Filename:="c:\temp\test\pentagon" & FileNumStr
".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindows.Close SaveChanges:=False
End Su
invoice to another name and print that new workbook and then close i
by using macro.
On my code, run the Save As command to create a new copy
of the Workbook(pentagon0002.xls), then don't open up that workbook
just close it.
that will give me the error "Object Required". What else I need t
fix?
Sub SaveandPrintout()
ActiveWindows.SelectSheets.PrintOut Copies:=1, Collate:=True
FileNum = ThisWorkbook.Sheets("Invoice").[B2].Value
FileNumStr = Format(FileNum, "0000")
ActiveWorkbook.SaveAs Filename:="c:\temp\test\pentagon" & FileNumStr
".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindows.Close SaveChanges:=False
End Su