Question : How to identify corrupt Excel-Objects?

I have some references to excel-objects (shapes, ranges,...) which can be deleted by the user. I would like to know, if the objects are still ok. I can use this objects and trap the error, but it seems to me not the elegant way. I also expect, that this is not pretty fast.

Is there another way to examine objects, if they still ok, or already destroyed?

Answer : How to identify corrupt Excel-Objects?

Look though what you ask cannot be done.  In terms of making it 'simple' the nearest I have got is a functiuon i.e.

Called as isnothing(myobj) returns true when it exists, if it is then deleted a subsequent attempt returns true since although obj is defined it has no name and as far as I can see EVERY object has the name property.

Chris
1:
2:
3:
4:
5:
Function isNothing(obj As Object) As Boolean
    On Error Resume Next
    isNothing = True
    isNothing = TypeName(obj.Name) = "Nothing"
End Function
Random Solutions  
 
programming4us programming4us