XP-Crash during call of .ExecWB

marcomania
marcomania used Ask the Experts™
on
Hi everybody,

i have the problem that my WinXP crashs(no bluscreen etc. its like pulling the plug) if i call
Call BrowserToPrint.Navigate(str_Time_HTML) 'this part works
BrowserToPrint.ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT)
in my VisualBasic 5.0 program.

Sometimes XP crashs during loading of the preview window, sometimes after pressing the print button.

I also tried the other options:
Call BrowserToPrint.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER)
Call BrowserToPrint.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER)

but it doesn't work. Has somebody an idea why XP can crash during this operation?









Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009

Commented:
What is in BrowserToPrint?  I Googled it and found absolutely nothing so it must be a sub or function in one of your modules.

Commented:
BrowserToPrint s the webbrowser object name
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009

Commented:
Sorry, stupid comment by me.  Looks like BrowserToPrint is the name of your WebBrowser Control. Duh....
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009

Commented:
Try creating a new Project with just a WebBrowser control and a CommandButton.

Paste the following code and hit the button.  Does it crash?

' -----------Begin Code
Private Sub Command1_Click()
    WebBrowser1.ExecWB OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT
End Sub

Private Sub Form_Load()
    WebBrowser1.Navigate "http://www.google.com"
End Sub

Author

Commented:
Hi,

i tried the simple version, it works perfect (without a crash) :-(

High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
Commented:
Then there is most likely something wrong with the old project.   Tis a pain in the butt.... but, I think you may be ok if you start with a new project and then add your components and copy your code over to the new project.

Good Luck....let us know how it goes.

Author

Commented:
After testing and testing and testing,
i found out that it must be a problem with my settings

because I tried to print directly with internet explorer ==> crash
i tried it from other computers everything works.

so I make a basic installation with my pc and then we will see

thx for your help

Author

Commented:
problem is solved,

we found out, that the reason for the xp-crash was a old printer-driver
after installing the new one, everything works perfect.
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009

Commented:
Thanx for the update!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial