ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Embedded Object Type in Worksheet (https://www.excelbanter.com/excel-programming/397403-finding-embedded-object-type-worksheet.html)

Barb Reinhardt

Finding Embedded Object Type in Worksheet
 
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


Jim Rech

Finding Embedded Object Type in Worksheet
 
MsgBox ActiveSheet.ChartObjects.Count

--
Jim
"Barb Reinhardt" wrote in message
...
|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
|



papou[_2_]

Finding Embedded Object Type in Worksheet
 
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

"Barb Reinhardt" a écrit dans le
message de news: ...
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




Barb Reinhardt

Finding Embedded Object Type in Worksheet
 
I believe I've figured out what I need.
Thanks,
Barb Reinhardt



"papou" wrote:

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

"Barb Reinhardt" a écrit dans le
message de news: ...
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






All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com