+ Reply to Thread
Results 1 to 4 of 4

Get the Result of Excel Dialog, when closing excel?

  1. #1
    m.ahrens
    Guest

    Get the Result of Excel Dialog, when closing excel?

    Hi All

    Is it possible to get the result of the Yes, No, Cancel Dialog that apers
    when i close an excel. It is asking if i would like to save the excel
    workbook.

    I need an event that apears if someone clicks No, or Cancel. Is there a way
    to get an event for these two actions? or something else i should do to know
    if somebody clicked no or cancel?

    my problem is, that i need to execute code after the
    workbookbeforeSave-Event. In the taskbar the Excel.exe process is not
    closing...if someone knows how i could solve that problem i would be very
    happy. then the first problem wouldn't be a problem anymore and i do not have
    to kill the Excel.exe process by myself...

    using c#, vs .net, vb.net is also understood

    thanks for your help
    m. ahrens


  2. #2
    Jim Cone
    Guest

    Re: Get the Result of Excel Dialog, when closing excel?

    m,

    Maybe this will help with the second problem...

    http://support.microsoft.com/?kbid=317109
    "When you automate a Microsoft Office application from
    Microsoft Visual Basic .NET or Microsoft Visual C# .NET,
    the Office application does not quit when you call the Quit method"

    Regards,
    Jim Cone
    San Francisco, USA


    "m.ahrens" <[email protected]> wrote in message
    news:[email protected]...
    > Hi All
    > Is it possible to get the result of the Yes, No, Cancel Dialog that apers
    > when i close an excel. It is asking if i would like to save the excel
    > workbook.
    > I need an event that apears if someone clicks No, or Cancel. Is there a way
    > to get an event for these two actions? or something else i should do to know
    > if somebody clicked no or cancel?
    > my problem is, that i need to execute code after the
    > workbookbeforeSave-Event. In the taskbar the Excel.exe process is not
    > closing...if someone knows how i could solve that problem i would be very
    > happy. then the first problem wouldn't be a problem anymore and i do not have
    > to kill the Excel.exe process by myself...
    > using c#, vs .net, vb.net is also understood
    > thanks for your help
    > m. ahrens



  3. #3
    m.ahrens
    Guest

    Re: Get the Result of Excel Dialog, when closing excel?

    thanks for your help! that was very helpfull!! Excel closes correctly now!

    But i have another problem... still need to get to know if the user clicked
    Yes,No,Cancel when he closes excel...what event do i have to use for that and
    how can i see what he has clicked on?

    thanks
    m.ahrens

    "Jim Cone" wrote:

    > m,
    >
    > Maybe this will help with the second problem...
    >
    > http://support.microsoft.com/?kbid=317109
    > "When you automate a Microsoft Office application from
    > Microsoft Visual Basic .NET or Microsoft Visual C# .NET,
    > the Office application does not quit when you call the Quit method"
    >
    > Regards,
    > Jim Cone
    > San Francisco, USA
    >
    >
    > "m.ahrens" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi All
    > > Is it possible to get the result of the Yes, No, Cancel Dialog that apers
    > > when i close an excel. It is asking if i would like to save the excel
    > > workbook.
    > > I need an event that apears if someone clicks No, or Cancel. Is there a way
    > > to get an event for these two actions? or something else i should do to know
    > > if somebody clicked no or cancel?
    > > my problem is, that i need to execute code after the
    > > workbookbeforeSave-Event. In the taskbar the Excel.exe process is not
    > > closing...if someone knows how i could solve that problem i would be very
    > > happy. then the first problem wouldn't be a problem anymore and i do not have
    > > to kill the Excel.exe process by myself...
    > > using c#, vs .net, vb.net is also understood
    > > thanks for your help
    > > m. ahrens

    >
    >


  4. #4
    Jim Cone
    Guest

    Re: Get the Result of Excel Dialog, when closing excel?

    m.ahrens,

    You are asking a blind man what it look like...

    In C#, do you have anything equivalent to "Typename".
    If so, it could possibly tell you whether Excel is still open...
    If TypeName(xlApp) = "Application" then Excel is still
    open (cancel was clicked).

    Also, you might be able to get the date last modified for the
    applicable file and compare it to the value saved before
    opening Excel to determine if Yes or No was clicked.

    There are probably better ways to do both.

    In Excel VBA, one can eliminate the offending message with...
    "Application.DisplayAlerts = False"
    or determine the "Saved" state of the workbook with...
    If ActiveWorkbook.Saved = True then (Yes was clicked).

    Regards,
    Jim Cone
    San Francisco, USA


    "m.ahrens" <[email protected]> wrote in message
    news:[email protected]...
    > thanks for your help! that was very helpfull!! Excel closes correctly now!
    > But i have another problem... still need to get to know if the user clicked
    > Yes,No,Cancel when he closes excel...what event do i have to use for that and
    > how can i see what he has clicked on?
    > thanks
    > m.ahrens


    > "Jim Cone" wrote:
    > > m,
    > > Maybe this will help with the second problem...
    > > http://support.microsoft.com/?kbid=317109
    > > "When you automate a Microsoft Office application from
    > > Microsoft Visual Basic .NET or Microsoft Visual C# .NET,
    > > the Office application does not quit when you call the Quit method"
    > > Regards,
    > > Jim Cone
    > > San Francisco, USA




    > > "m.ahrens" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi All
    > > > Is it possible to get the result of the Yes, No, Cancel Dialog that apers
    > > > when i close an excel. It is asking if i would like to save the excel
    > > > workbook.
    > > > I need an event that apears if someone clicks No, or Cancel. Is there a way
    > > > to get an event for these two actions? or something else i should do to know
    > > > if somebody clicked no or cancel?
    > > > my problem is, that i need to execute code after the
    > > > workbookbeforeSave-Event. In the taskbar the Excel.exe process is not
    > > > closing...if someone knows how i could solve that problem i would be very
    > > > happy. then the first problem wouldn't be a problem anymore and i do not have
    > > > to kill the Excel.exe process by myself...
    > > > using c#, vs .net, vb.net is also understood
    > > > thanks for your help
    > > > m. ahrens



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1