Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- sakun ----------------------------------------------------------------------- sakung's Profile: http://www.excelforum.com/member.php...fo&userid=3723 View this thread: http://www.excelforum.com/showthread.php?threadid=57062 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vba - Save but don't close | Excel Worksheet Functions | |||
Save/Close All | Excel Discussion (Misc queries) | |||
To save and close | Excel Worksheet Functions | |||
I like to open a folder,auto print,save then close | Excel Programming | |||
Close without save | Excel Programming |