Finding Embedded Object Type in Worksheet

G

Guest

I have the following snippet of code:

With oWS
If .OLEObjects.Count > 0 Then
For i = 1 To .OLEObjects.Count
Debug.Print .OLEObjects(i).Name

Next i
End If
End With

I really want to know if the OLEObject is an Excel chart? How do I do that?

Thanks,
Barb Reinhardt
 
J

Jim Rech

MsgBox ActiveSheet.ChartObjects.Count

--
Jim
|I have the following snippet of code:
|
| With oWS
| If .OLEObjects.Count > 0 Then
| For i = 1 To .OLEObjects.Count
| Debug.Print .OLEObjects(i).Name
|
| Next i
| End If
| End With
|
| I really want to know if the OLEObject is an Excel chart? How do I do
that?
|
| Thanks,
| Barb Reinhardt
|
 
P

papou

Hello Barb
Why not use the ChartObjects method?

For i = 1 To oWS.ChartObjects.Count
MsgBox oWS.ChartObjects(i).Name
Next i

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top