View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Worksheet close event++?

Normally the sheet is active when user manually deletes it. After it's
deleted a Sheet Activate event will fire, both at Workbook and Application
levels.

Either directly in, or called from this event you can check your sheet still
exists, eg

Dim ws as worksheet
On error Resume Next
Set ws = MyGlobalRange.Parent
If Err.number then
Set MyGlobalRange = Nothing
'etc
End if

Regards,
Peter T

"has ex" wrote in message
...
Thanks for the reply,
I have an out of proc application (automating Excel with C++ client)
that holds references to many ranges. If user deletes one of the

worksheets
that I have a reference, then I need to clear my pointers. I am able to do
this if the user deletes the workbook, because I get an event on the

close,
but not if he deletes a single worksheet.
Many thanks

Has