軟體: Excel 2007, Win7
硬體: Intel i3-3240T, RAM 8G
我用excel巨集畫大量曲線圖,一開始很快,可是run了大約100個之後就開始變很慢了,
請教各位前輩專家如何解決? 感謝
程式碼如下;
Sub Macro1()
For i = 2 To 1000 Step 2
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range(Cells(1, i), Cells(25, i + 1))
ActiveChart.ChartType = xlLine
ActiveChart.PlotBy = xlColumns
Dim mychart As Chart
Set mychart = ActiveSheet.ChartObjects(i / 2).Chart
mychart.Export Filename:="d:\sales.gif" & Cells(1, i) & ".gif", FilterName:="GIF"
Next
End Sub