Hi,
I have a problem in moving the chart to Sheet2 Location in Excel. Its working well in Microsoft Office 2003 (Excel 2003). But not working in Excel 97. Here is my code part. The logic is
objExcelChart = CType(objExcelWB.Charts.Add(missing, missing, missing, missing), Excel.Chart)
The above line is creating the chart sheet in excel then the below code lines are moving this chart sheet to sheet1 if its in Daily Condition . When it tries to move the second chart to sheet2 there is a problem. Its still locating the chart2 to sheet1 not moving it to Sheet2.
is there any work around it to solve this issue.
If (strTimeSpan = "Daily") Then
objExcelChart.SeriesCollection(1).XValues() = "=Sheet1!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet1")
ElseIf (strTimeSpan = "Weekly") Then
objExcelChart.SeriesCollection(1).XValues() = "=Sheet2!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet2")
Else
objExcelChart.SeriesCollection(1).XValues() = "=Sheet3!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet3")
End If
Thanks
Siva
I have a problem in moving the chart to Sheet2 Location in Excel. Its working well in Microsoft Office 2003 (Excel 2003). But not working in Excel 97. Here is my code part. The logic is
objExcelChart = CType(objExcelWB.Charts.Add(missing, missing, missing, missing), Excel.Chart)
The above line is creating the chart sheet in excel then the below code lines are moving this chart sheet to sheet1 if its in Daily Condition . When it tries to move the second chart to sheet2 there is a problem. Its still locating the chart2 to sheet1 not moving it to Sheet2.
is there any work around it to solve this issue.
If (strTimeSpan = "Daily") Then
objExcelChart.SeriesCollection(1).XValues() = "=Sheet1!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet1")
ElseIf (strTimeSpan = "Weekly") Then
objExcelChart.SeriesCollection(1).XValues() = "=Sheet2!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet2")
Else
objExcelChart.SeriesCollection(1).XValues() = "=Sheet3!R6C1:R" + strRowCount + "C1"
objExcelChart.Location(Excel.XlChartLocation.xlLocationAsObject, "Sheet3")
End If
Thanks
Siva