473,385 Members | 1,693 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 2018

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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.