diff --git a/BaiHu/Tools/DocxTuBiaoRead.py b/BaiHu/Tools/DocxTuBiaoRead.py index 0be6d3e8..c430fa69 100644 --- a/BaiHu/Tools/DocxTuBiaoRead.py +++ b/BaiHu/Tools/DocxTuBiaoRead.py @@ -31,7 +31,8 @@ for inline_shape in doc.InlineShapes: # print(pic1.Chart.ChartData.Workbook.FullName) print(pic1.Chart.ChartStyle) print(pic1.Chart.ChartTitle.Text) - print(pic1.Chart.ChartData.Workbook.Worksheets(1)) + sheet = pic1.Chart.ChartData.Workbook.Worksheets("Sheet1") + print(sheet.Range("A2").Text) idx = idx + 1 # 这里可以对图表进行操作,比如获取图表的类型、数据等 doc.Close()