-
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.
-
Have you tried the On Error Resume Next statement?
-
This can't work as VB is not the active application when the dr watson error appears
Any Other bright ideas?????????????
-
If your application is halted how do you intend to get it to process any command at all?
-
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