Automating Excel from C#, Adding Picture Charts

  • Thread starter Thread starter saragoesnuts
  • Start date Start date
S

saragoesnuts

I have a program that automates to Excel with information in tables.

I want to add charts to the excel file (pie charts, bar charts, etc).
Is this possible?
 
If you mean you want to chart the data you have put into Excel,
then yes, it is possible through OLE Automation. I haven't done
it in C#; I do this sort of thing in VB. Start by looking at the
code generated by using MacroRecord when you create the chart
in Excel manually. You can't use it 100% like it is, but it
will send you in the right direction.

Robin S.
 
Thank you for the reply, but can you be a little more specific?
I create a Page object and set its content type to
"application/ms-excel" and add a header and send it off and it opens in
Excel.
Can I use this same method to make visual charts? Do you know where I
could find some code?

Thanks again,
Sara
 
Are you talking about a Windows Forms app, or a Web Forms app?
What version of .Net are you using? 2003 or 2005?

What I'm talking about is doing OLE automation. I don't think you
can do it from a web app. You basically open Excel, put data in the
data sheet, then chart the data, all using automation.

Robin S.
---------------------------------
 
Back
Top