Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 图表对象删除错误_Excel_Vba - Fatal编程技术网

Excel 图表对象删除错误

Excel 图表对象删除错误,excel,vba,Excel,Vba,我正在做清除功能。每当没有要删除的图表对象时,就会弹出一个错误。有没有办法使它无错误?当它没有要清除的图表时,它只是保持原样 Sheet6.ChartObjects.Delete 一种方法是 On Error Resume Next Sheet6.ChartObjects.Delete On Error GoTo 0 编写仅删除图表对象的条件语句

我正在做清除功能。每当没有要删除的图表对象时,就会弹出一个错误。有没有办法使它无错误?当它没有要清除的图表时,它只是保持原样

Sheet6.ChartObjects.Delete
一种方法是

On Error Resume Next
Sheet6.ChartObjects.Delete
On Error GoTo 0

编写仅删除图表对象的条件语句