View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default How do I tell if user has closed Excel.

Tim,
Why is the workbook not closing ?
If your closing code crashes Excel, seems there is a problem with the code
or the way the objects are referenced/destroyed.

NickHK

"Tim Marsden" wrote in message
...
Wei Lu,

We use the Workbooks for data capture, each workbook has a specific
function, and an object is created to handle validation, data retrieval

and
update. Different objects may be created for differnet Workbooks. These
objects contain business logic for the Workbook. As the user uses the
workbook, calls are made to functions in the associated object. These

objects
must be managed, i.e created when the Workbook is opened and destroyed

when
it is closed. The Workbook is useless without is corrsponding object. The
Beforeclose event can be used to destroy the object and tidied up, but

this
is only effective if the workbook is then closed. I have tried forcing the
close, but this seems to crash excel.

Regards
Tim

--
Tim Marsden


"Wei Lu [MSFT]" wrote:

Hello Tim,

As Nick has said, there are no indication to specify the Excel

application
close.

I still interested on your Menu options. Do you mean the menubar in the
Excel or other controls in the workbook?

Since the Menu Options is related with workbooks, I don't know why your
need to access a global variable.

I am not sure but on my first thought, the global variable will be the
cause of this issue.

Could you please let me know some business logical in your application

so
that we may found an alternate way to accomplish this?

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no

rights.