1
下面是代碼@davidzemens非常友好地提供給我的其他question on runtime error的一部分。我想展示這個圖表對象的輪廓。Excel VBA:在圖表對象中顯示行(輪廓)
有沒有一種方法可以使用,而不必命名圖表對象(ChtObj.Name = "ChartName"
),選擇並激活它,然後使用ActiveSheet.Shapes("ChartName").Line.Visible = msoTrue
?
'Add the ChtObj frame:
Set ChtObj = ws.ChartObjects.Add(100, 100, 400, 400)
'Size the chart, paste the picture in the chart, export
With ChtObj
.Width = shp.Width
.Height = shp.Height
shp.Copy
Sleep 1000 '1000 milliseconds = 1 second
.Chart.Paste
.Chart.Export Filename:=fname, FilterName:="png"
.Delete
End With
謝謝你這麼多@JChomel。對不起原來的格式。需要閱讀如何將鏈接鏈接到文本中。 – user110084