Hi all...
I'm trying to change a MSChart that's embebbed on a Powerpoint
template and i'm starting to get nervous :-)
It seems that i'm able to call just one method/setter, the one called
ChartType. All other calls get the same error, "Unknown Name":
'System.Runtime.InteropServices.COMException' in mscorlib.dll
This is my code:
if (theShape.OLEFormat.ProgID=="MSGraph.Chart.8")
{
object PPOLE = theShape.OLEFormat;
PPOLE.Activate();
object PPTChart = PPOLE.Object;
object[] Parameters = new Object[1];
Parameters[0] = 4; //xlLine = 4
//This works:
PPTChart.GetType().InvokeMember("ChartType",
BindingFlags.SetProperty, null, PPTChart, Parameters);
Parameters[0] = 1;
//This DON'T:
PPTChart.GetType().InvokeMember("DrawMode", BindingFlags.SetProperty,
null, PPTChart, Parameters);
object []Parameters2 = new Object[1];
object [,]Relleno = {{"Company","Lalalal"},{"1","2"}};
Parameters2[0] = Relleno;
//This DON'T:
PPTChart.GetType().InvokeMember("ChartData",
BindingFlags.SetProperty, null, PPTChart, Parameters);
}
BTW: If you inspect the MSChart class (using the OLE/COM Viewer for
example) you can see that the only setter that starts with lowercase
is chartType, the rest all start with uppercase. I guess that it
doesn't matther at all, since y can call "chartType" even with all in
uppercase ("CHARTTYPE"), so i guess it's not case sensitive.