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.
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,340
Office Version
2019, 2016, 2013
Platform
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
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

Moderator
Joined
Oct 23, 2004
Messages
10,340
Office Version
2019, 2016, 2013
Platform
Windows
can you force it to print direct rather than spool the job ?
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
811
You can stop the spooler.
 

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,649
Office Version
2013
Platform
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
811
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
 

Watch MrExcel Video

Forum statistics

Threads
1,100,091
Messages
5,472,421
Members
406,816
Latest member
SUBHAS1812

This Week's Hot Topics

Top