Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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" wrote in message
...
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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
I can see th formula result in the dialog box but not in the cell Worried Excel Worksheet Functions 1 October 27th 05 08:37 PM
Dialog box when closing an unsaved spreadsheet Kathy4080 Excel Discussion (Misc queries) 1 January 4th 05 10:28 PM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM


All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"