Hi experts,
I am trying to update the 5 series in an existing chart in an XL spreadsheet.
Internally (when I look in the excel's VB editor), the chart is referred to as "Chart2"
Here is the snippet of code that continues to return this error:
"1004 - Unable to set the values Property of the series class"
What am I doing wrong? The data that is in the spreadsheet resides on sheet1, and the chart, as I said, is referred to has "Chart2." The sheet1 data has 15 rows and 50 cols of data, so I am not referring to an empty range.
I have also tried = "=Chart2!$Q$2:$Q$10" and no go.
Help!
JBG
I am trying to update the 5 series in an existing chart in an XL spreadsheet.
Internally (when I look in the excel's VB editor), the chart is referred to as "Chart2"
Here is the snippet of code that continues to return this error:
"1004 - Unable to set the values Property of the series class"
Code:
.....etc
Dim objExcelApp As Object
Dim objExcelSheet As Object
Dim objExcelWorkbook As Excel.Workbook
Dim objChart As New Excel.Chart
Dim objSeries As Excel.Series
Dim objSC As Excel.SeriesCollection
.....etc
Set objExcelApp = CreateObject("Excel.Application")
Set objExcelWorkbook = objExcelApp.Workbooks.Open(g_strXLpath)
Set objChart = objExcelWorkbook.Charts(1)
objChart.Activate
For Each objSeries In objChart.SeriesCollection
objSeries.Values = "=Sheet1!$Q$2:$Q$10" (<-errors here)
Next
What am I doing wrong? The data that is in the spreadsheet resides on sheet1, and the chart, as I said, is referred to has "Chart2." The sheet1 data has 15 rows and 50 cols of data, so I am not referring to an empty range.
I have also tried = "=Chart2!$Q$2:$Q$10" and no go.
Help!
JBG