error handling - check chart existance

  • Thread starter Thread starter annette2002
  • Start date Start date
A

annette2002

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
 
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

(e-mail address removed)

| 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
|
 

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

Back
Top