Creating Excel chart sheet using C#

S

Stan

Hello,

I'm writing a tool using VS 2005 SP1 (C#) which processes some survey data
within Excel (2007). And have gotten the point where I need to create a chart
displaying some results. However, when executing the 2nd line of code below.
I get "Exception from HRESULT: 0x800A03EC." After lots of searching , etc, I
haven't been able to narrow down a cause. Any ideas?



Chart ch = (Chart)wb.Charts.Add(Type.Missing, (Worksheet)wb.Worksheets[1],
1, Microsoft.Office.Interop.Excel.XlChartType.xlXYScatter);

ch.SetSourceData(ws3.get_Range("J2:K38",Type.Missing),
Microsoft.Office.Interop.Excel.XlRowCol.xlRows);
 

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

Top