run time error 2147417848 VB6 ShowPrinter

I have been running this line of code in my program for over 10 years running XP/Vista/7/8.

CommonDialog1.FLAGS = CommonDialog1.FLAGS - &H900000

Now I'm getting this error message
"run time error 2147417848 (80010108':
Method 'ShowPrinter' of object 'ICommonDialog' failed"

I had gotten this message in the past but when I would restart the program is would than work. Now it doesn't work at all.

I did a Google search only ten results and no answer.

I hope an expert can solve this for me soon.

Who is Participating?
eemitConnect With a Mentor Commented:
You should use a valid Flags Property for Print Dialog e.g.:

CommonDialog1.Flags = cdlPDDisablePrintToFile Or cdlPDNoSelection

Open in new window

These constants are listed in the Microsoft CommonDialog Control (MSComDlg) object library in the Object Browser (F2), "PrinterConstants".
slwebber99Author Commented:
Thank you very much. It now works.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.