Question

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.

Was it helpful?

Solution 2

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 :)

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top