Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to speed vba PageSetup - found by accident

Status
Not open for further replies.

tman138

IS-IT--Management
Nov 27, 2001
128
0
0
US
thread707-1434802
I have a workbook that has a dynamic number of worksheets and I needed to set the page to landsscape and fit to 1 page hig & wide etc. and found it ran extremely slow. I stumbled on the Excel 4 macro solution but was uncertain of how to employ the macro so I decided to first run my page setup routine slowly in vBA until I figured it out. My app launches from Access, calls Excel and then runs the macro and I have a utility PC that I run a scheduler on where I was to deploy this app. This PC had no printer attached and none installed. Since the page setup routine calls the default print driver, the macro skipped my page setup routines. To remedy this I decided to trick the app by installing a phantom printer and setting it as the default. I just went to printer setup, selected a local printer install on LPT1 and installed a HP Laserjet 1100 driver. (There is no printer attached to this PC) When my automated workbook opens, the page setup routines fly and complete sucessfully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top