Create Printer Error for testing purposes

ajgarrison

New Member
Joined
Jun 16, 2019
Messages
8
I have written an error handler for a "print" command button. The button prints several reports based upon the form with the "print" button. My code is to generate a VbRetryCancel message box if there is an error at the printer.

I need to be able to generate something at the printer that will return an error so I can clear the error and attempt to retry in order to resume printing.

Any suggestions, thanks in advance.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
physically turn it off, unplug the LAN, remove a colour cartridge, remove paper or add really thick paper to force a jam any of those should give you numerous errors
 

ajgarrison

New Member
Joined
Jun 16, 2019
Messages
8

ADVERTISEMENT

I had tried turning off and unplug LAN. These did not return an Access error. Access still printed and the print was in the Spool until I cleared the error on the printer.
 

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
can you force it to print direct rather than spool the job ?
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
901

ADVERTISEMENT

You can stop the spooler.
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Partly at least that's how printers work. It should actually print the job once the jam/paper problem/electrical supply is fixed (so you don't necessarily need to hit a print button again).
 

ajgarrison

New Member
Joined
Jun 16, 2019
Messages
8
Thanks to all. I'm a novice and still have had no success.
So far I have not successfully thrown an error to "fire" my error handler.

I appreciate the help I'm getting.
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
901
Well I expect the Raise function would do it? Wouldn't take a minute to test?
Not something I've done I admit. I spend all my time trying to avoid them. :D
 

Forum statistics

Threads
1,141,406
Messages
5,706,268
Members
421,437
Latest member
GijoeBlack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top