By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,835 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,835 IT Pros & Developers. It's quick & easy.

Automating Excel from C#, Adding Picture Charts

P: n/a
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?

Jan 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
----------------------------
<sa**********@gmail.comwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com...
>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?

Jan 26 '07 #2

P: n/a
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
On Jan 26, 12:07 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
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.
----------------------------<saragoesn...@gmail.comwrote in messagenews:11**********************@a34g2000cwb.g ooglegroups.com...
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?- Hide quoted text -- Show quoted text -
Jan 26 '07 #3

P: n/a
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.
---------------------------------
<sa**********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
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
On Jan 26, 12:07 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
>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.
----------------------------<saragoesn...@gmail.comwrote in
messagenews:11**********************@a34g2000cwb. googlegroups.com...
>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?- Hide quoted text -- Show quoted text -

Jan 27 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.