S
Santiago Gomez
I am getting an "Invalid Use of Property" error when I run the code:
Public g_chtUsage As Excel.Chart
Public m_appXl As New Excel.Application
Public m_shUsageData As Excel.Worksheet
Public m_wbEnergy As Excel.Workbook
Sub CreateChart()
Set g_chtUsage = m_wbEnergy.Charts.Add
With g_chtUsage
.ChartType = xlAreaStacked
.SetSourceData Source: m_shUsageData.Range ("A2:A30,B2:B30"), _
PlotBy:=xlColumns
End With
End Sub
It breaks at the .Range part.
Any ideas?
Public g_chtUsage As Excel.Chart
Public m_appXl As New Excel.Application
Public m_shUsageData As Excel.Worksheet
Public m_wbEnergy As Excel.Workbook
Sub CreateChart()
Set g_chtUsage = m_wbEnergy.Charts.Add
With g_chtUsage
.ChartType = xlAreaStacked
.SetSourceData Source: m_shUsageData.Range ("A2:A30,B2:B30"), _
PlotBy:=xlColumns
End With
End Sub
It breaks at the .Range part.
Any ideas?