importing Excel charts into PowerPoint using C#

  • Thread starter Thread starter HibernatingBear
  • Start date Start date
H

HibernatingBear

Hello,

I'm a relative newbie to C#, and would be grateful for any helpful
suggestions. I am working on a Web application in .NET 2005.

I've been tasked with programming an automated PowerPoint presentation
in C#, and need to add an Excel chart to one of the slides.

I've looked on the Microsoft Knowledge Base at http://support.microsoft.com/?kbid=303718
and created their sample slides on my machine, and am trying to go
beyond that. I've managed to make changes to the slides, add my own
material and make other changes, but adding a chart from Excel has me
completely stumped.

Have done many searches, found examples in VB, which give me some idea
of what needs to be done, but I'm not yet at the level where I can
easily translate that into C#. Or maybe I'm missing a library, or
didn't add something else, I don't know.

Thanks!
 
Sorry to say you probably won't find many folks here who speak C#.
Someone might show up who does, but I'd suggest checking in some of
the Developer news groups where you will find more speakers of C#.

Brian Reilly, MVP
 
Thanks for your reply. Did check the newsgroups, posted the same
question with no replies. Funny, others who posted questions around
the same day as myself had no replies, either.

Wanted to give an update, in case someone else comes hunting for a
solution, or if I forget how I did this sometime in the future.

Between MSDN's article on 2007 Powerpoint and Excel, at
http://msdn2.microsoft.com/en-us/library/bb676881.aspx, and a tiny
little detail I stumbled across in http://support.microsoft.com/kb/171162,
where the chart name defaults to "Chart 1," I managed to add the
desired chart to my PowerPoint slide.

I simply changed the pptNS to PowerPoint and xlNS to Excel, and the
paths to point to my files.

If anyone else out there knows how to name a chart in Excel 2005, and
can post details, that would be appreciated! Did try defining a name
for the chart, but that didn't work. Looked through the properties of
the names and discovered that no ranges were in the properties.
 
Back
Top