Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Charts("Vendor").ChartTitle.Text = "Test"
正在抛出下标错误。该图表确实存在并被命名为供应商。
有任何想法吗?
Chart是 a 的子对象ChartObject(就像@DerekCheng 提到的那样,包含在工作表中);因此,您需要Chart直接从那里获取。试试这个。
Chart
ChartObject
Worksheets("YourSheetName").ChartObjects("Vendor").Chart.ChartTitle.Text = "Test"