Loop through all charts in a workbook with VBA

后端 未结 2 1844
北恋
北恋 2021-01-06 07:14

I am trying to loop through all charts in a workbook. Why is option 1 working, but option 2 not?

\'OPTION 1

For Each sht In ActiveWorkbook.Worksheets         


        
2条回答
  •  走了就别回头了
    2021-01-06 07:52

    As the documentation states, Application.Charts returns a Sheets collection containg all chart sheets (not charts!). For Worksheet.ChartObjects, however, the documentation says that it returns a ChartObjects collection containing all charts on that sheet.

提交回复
热议问题