Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel crashes after printing via VBA

The code looks like this:

Sheets(Array("MEMO", "ODC ETC", "BURN RATE")).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

After returning from the sub above, the application proceeds with
programmatically manipulating the workbook. The first time through, it
prints correctly, but then Excel hangs, and then crashes.

I'm currently avoiding this by returning from the sub, and then throwing up
a Yes/No message box to effectively 'pause' the app before proceeding with
the code.

Suboptimal.

Is it possible to make VBA wait for the print job to be
printed/spooled/whatever before proceeding with code?

Thanks In Advance - Mike D.
--
- MJD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Excel crashes after printing via VBA

This line pauses for 3 seconds before calling a subroutine.

Application.OnTime earliesttime:=Now + TimeSerial(0, 0, 3),
procedu="UnhideColumns"

It doesn't actually wait for a process to complete, just for a fixed time.

--
Ian
--
"Mike D" wrote in message
...
The code looks like this:

Sheets(Array("MEMO", "ODC ETC", "BURN RATE")).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

After returning from the sub above, the application proceeds with
programmatically manipulating the workbook. The first time through, it
prints correctly, but then Excel hangs, and then crashes.

I'm currently avoiding this by returning from the sub, and then throwing
up
a Yes/No message box to effectively 'pause' the app before proceeding with
the code.

Suboptimal.

Is it possible to make VBA wait for the print job to be
printed/spooled/whatever before proceeding with code?

Thanks In Advance - Mike D.
--
- MJD



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel crashes bigfile Setting up and Configuration of Excel 2 July 27th 09 04:07 PM
F11 Crashes Excel kirkm[_7_] Excel Programming 2 March 14th 08 02:07 AM
excel crashes Matt Excel Discussion (Misc queries) 0 April 20th 07 07:52 PM
Workbook_onChange that shows/hides rows crashes after printing? [email protected] Excel Programming 0 February 22nd 07 01:08 PM
Excel 97 crashes ?!? Tom Excel Programming 1 June 28th 04 02:34 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"