Adding chart in PowerPoint using C++ OLE automation

0

i've encountered a problem when tried to add chart to PowerPoint in C++

AutoWrap(DISPATCH_METHOD, NULL, pShapes, L"AddChart", 0);

It throws "0x80020009 Exception occured" error. That code works for AddTable, AddTextbox etc.

c++
com
automation
powerpoint
ole
asked on Stack Overflow Mar 10, 2014 by Bartek Kozłowski • edited Mar 10, 2014 by Bartek Kozłowski

2 Answers

0

I think you'll find help here: http://support.microsoft.com/kb/222960

Note: Not all functions available in Office are available through ole in C++. AddChart may not be supported. If you can, look at using COM to call a managed dll. It is much easier. You will get full support when you add references to Powerpoint in .NET.

MDSN Interop Documentation: http://msdn.microsoft.com/en-us/library/ms173184.aspx

answered on Stack Overflow Mar 10, 2014 by john.dennis
0

I've managed to resolve the problem. There are two solutions:

-have PowerPoint opened in background

-make powerpoint visible when creating instace of it (by default it's invisible)

I don't know why it must be done this way, but it works :)

answered on Stack Overflow Mar 12, 2014 by Bartek Kozłowski

User contributions licensed under CC BY-SA 3.0