ASP.Net Moving Chart to Excel Sheet 2

Joined
Jun 15, 2007
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top