473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MSChart late binding: I'm getting crazy!!

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.
Nov 16 '05 #1
0 2019

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Composer | last post by:
I've read many postings about the problem of Access.References.IsBroken and the consensus seems to be that late binding is the cure-all. I have a very complex Access application that needs...
9
by: Zlatko Matiæ | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
0
by: Alejandro Reyero | last post by:
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...
3
by: Thomas Müller-Lynch | last post by:
How can I avoid late binding with the directive strict = tru My ASP .net-file looks like this <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true% .. dim footerValues as Arra footerValues =...
8
by: scorpion53061 | last post by:
I am sorry for this but I am not getting an answer elsewhere so I thought I would try here. It seems the safer way to go prior to deployment is to change my early binding to late binding to...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
6
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document...
9
by: Miro | last post by:
VB 2003 and Im still new to vb, so i hope i can explain this as best I can. I have a variable defined as such: ( simple example ) Dim AVariableOfSorts(,) As Object = _ { _ {"Last", "String",...
1
by: Adotek | last post by:
Hi All, I've just converted a solution from .Net v1.1 to v2.0, by allowing Visual Studio 2005 to do the conversion. Since doing so, I am getting a compilation error as follows: "Option...
15
by: tshad | last post by:
I have the following in my VS 2008 code: parameters(0).Value = Session("User").CompanyID I assume this means that since there is no "User" at this point I can't do this. But it will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.