|
-
Dec 4th, 2000, 06:47 PM
#1
Thread Starter
Addicted Member
I have a VB app that opens excel spreadsheets. Sometimes when the spreadsheet is corrupt excel terminates abnormally and causes a DR Watson error, which displays a modal dialog box. Is there any way of getting VB to either pass a key stroke ( to cancel the box, this box is only a notification message) or terminate this dialog box so the VB app may continue. It appears that the code in VB is halted at the point when the Dr Watson message appears. Control only seems to pass back to VB when you cancel or Ok the dialog box.
-
Dec 4th, 2000, 10:07 PM
#2
Addicted Member
Have you tried the On Error Resume Next statement?
-
Dec 4th, 2000, 10:12 PM
#3
Thread Starter
Addicted Member
This can't work as VB is not the active application when the dr watson error appears
Any Other bright ideas?????????????
-
Dec 5th, 2000, 03:05 AM
#4
Addicted Member
If your application is halted how do you intend to get it to process any command at all?
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Dec 5th, 2000, 09:38 AM
#5
Lively Member
Might Work
Dim WshShell
Set WshShell = CreateObject ("WScript.Shell")
WshShell.AppActivate("Notepad")
WshShell.SendKeys vbCR
What this would do is send a carriage return to notepad.So you would need to expand on it. To Test it open notepad type something in and then select save as from the menu. It will envoke a dialogue box.
run the above code and it should emulate clicking "Save" in the notepad dialogue box.
Hope this helps
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|