|
a1到a1000有需要打开工作表的完整路径,需要挨个打开进行画图,提示“定义程序或者对象错误”。标红的部分需要如何修改?
Sub bbb()
Dim r
Dim wb1
For Each r In Range("a1:a1000")
Workbooks.Open r
Columns("A:B").Select
Range("B1").Activate
ActiveSheet.Shapes.AddChart2(240, xlXYScatterSmoothNoMarkers).Select
ActiveChart.SetSourceData Source:=Range("$A:$B")
ActiveSheet.Shapes("图表 1").ScaleWidth 1.6243055556, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("图表 1").ScaleHeight 1.0046296296, msoFalse, _
msoScaleFromTopLeft
ActiveWindow.SmallScroll Down:=-9
ActiveWorkbook.Save
Application.DisplayAlerts = False
'关闭
ActiveWorkbook.Close True
Next r
End Sub
|
|