• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 813
  • Last Modified:

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
CommonDialog1.ShowPrinter

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.

Thanks
primtererror.JPG
0
slwebber99
Asked:
slwebber99
1 Solution
 
eemitCommented:
You should use a valid Flags Property for Print Dialog e.g.:

CommonDialog1.Flags = cdlPDDisablePrintToFile Or cdlPDNoSelection
CommonDialog1.ShowPrinter

Open in new window


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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now