?
Solved

XP-Crash during call of .ExecWB

Posted on 2003-10-24
9
Medium Priority
?
445 Views
Last Modified: 2010-05-18
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?









0
Comment
Question by:marcomania
  • 5
  • 3
9 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9614804
What is in BrowserToPrint?  I Googled it and found absolutely nothing so it must be a sub or function in one of your modules.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9614840
BrowserToPrint s the webbrowser object name
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9614849
Sorry, stupid comment by me.  Looks like BrowserToPrint is the name of your WebBrowser Control. Duh....
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9614985
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
0
 

Author Comment

by:marcomania
ID: 9625343
Hi,

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

0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 9625358
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.
0
 

Author Comment

by:marcomania
ID: 9625537
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

0
 

Author Comment

by:marcomania
ID: 9625812
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.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9626966
Thanx for the update!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question