Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I need to open a workbook, print it and close, for example from a .ba file, but that the user can open the workbook without problem. I write this: Private Sub WorkBook_Open() ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Application.Quit End Sub But when I execute excel.exe c:\myworkbook the excel ask my if I wan to activate/desactivate macros. Somebody same me that the best option is to create a new workbook an write Private Sub Auto_Open() Workbooks.Open Filename:="c:\example.xls" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Application.Quit End Sub It's possible to do something like this but "c:\example.xls" will be a parameter -- despistad ----------------------------------------------------------------------- despistado's Profile: http://www.excelforum.com/member.php...fo&userid=1629 View this thread: http://www.excelforum.com/showthread.php?threadid=27729 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I close only 1 workbook when I have many open? | Excel Discussion (Misc queries) | |||
Open, print and close workbook | Excel Programming | |||
Close Open Workbook | Excel Programming | |||
Close Open Workbook | Excel Programming |