ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error handling - check chart existance (https://www.excelbanter.com/excel-programming/300845-error-handling-check-chart-existance.html)

annette2002[_2_]

error handling - check chart existance
 
I've a chart sheet namely "chart1" and I want to check if this char
exists in the file before calling other functions. without checkin
this in the working file and that the chart does not exist.
is there a question to catch this?:rolleyes

--
Message posted from http://www.ExcelForum.com


William[_2_]

error handling - check chart existance
 
Hi annette

Sub test()
Dim ch As Chart
For Each ch In ThisWorkbook.Charts
If ch.Name = "Chart1" Then
MsgBox "Chart exists"
Exit For
End If
Next ch
End Sub

--
XL2002
Regards

William



"annette2002 " wrote in message
...
| I've a chart sheet namely "chart1" and I want to check if this chart
| exists in the file before calling other functions. without checking
| this in the working file and that the chart does not exist.
| is there a question to catch this?:rolleyes:
|
|
| ---
| Message posted from
http://www.ExcelForum.com/
|




All times are GMT +1. The time now is 02:01 AM.

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