开发者

1004 Runtime Error on adding Excel chart

Consider this code:

Subroutine(ByRef objExcelApp As Object)

Dim objChart As Excel.Chart<br>
Dim objChartAdd As Excel.Chart


Set objChart = Charts.Add

'Plotting graph in excel 

'After completion 
Set objChart = Nothing

End Sub

When I run this code, everything runs fine, and without closing application if rerun it with another report type - it prompts an error 1004 at Set objChart = Charts.Add

An开发者_Go百科y help, anyone can provide will be greatly appreciated.


Can you add a chart in the UI? I bet you're in a situation where a chart cannot be added (multiple sheets selected; workbook not activated; protected range active; etc).

Chris

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜