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
精彩评论