Results 1 to 5 of 5

Thread: Tricky Question

  1. #1

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Angry

    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.

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138
    Have you tried the On Error Resume Next statement?

  3. #3

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Unhappy

    This can't work as VB is not the active application when the dr watson error appears

    Any Other bright ideas?????????????

  4. #4
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    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

  5. #5
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Post 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
  •  



Click Here to Expand Forum to Full Width