I wrote the program for creating Chart from data. I use the "chart.add" code, so each time they press a button, a new chart is created.
But I hope that each time they open the file, it will automatically remove all the chart they previous done. i use the following code:
Private Sub Workbook_Open()
If Charts.Count <> 0 Then
Charts.Delete
End If
End Sub
However, Each time the file is opened, it will prompt you and I must press yes to confirm deleting. How can I delete it without the prompt message.
But I hope that each time they open the file, it will automatically remove all the chart they previous done. i use the following code:
Private Sub Workbook_Open()
If Charts.Count <> 0 Then
Charts.Delete
End If
End Sub
However, Each time the file is opened, it will prompt you and I must press yes to confirm deleting. How can I delete it without the prompt message.