Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OleContainers, Excel and 'Interface not supported' error

654 views
Skip to first unread message

Mark Sandy

unread,
Mar 7, 2003, 10:41:53 AM3/7/03
to
Hello,
I am trying to open an excel file in a TOleContainer using
OleContainer1.CreateObjectFromFile ('Foo.XLS', False).
Then I need access to the ExcelSheet. As soon as I use
OleContainer1.OleObject, I get an exception 'Interface not supported'.

This is driving me crazy

Can anyone tell me what I should do?

Thanks in advance

Mark

Mark Sandy

unread,
Mar 12, 2003, 3:36:34 AM3/12/03
to
Ok,

nobody likes me, nobody understands me, nobody talks to me ...
Then, the only person which understands my problem is I.

I fixed it = I don't use TOleContainer, as it is just a container, not
really a living object...

"Mark Sandy" <msa...@csiberlin.de> schrieb im Newsbeitrag
news:3e68bd3d$1...@newsgroups.borland.com...

Oliver Albrecht

unread,
Mar 12, 2003, 8:43:52 AM3/12/03
to
On Fri, 7 Mar 2003 16:41:53 +0100, Mark Sandy wrote:

Hi mark,

you can't OleVariant direct as an Interface. You must first do a cast :
(OleContainer1.OleObject as IUnknown) as Application (the root interface of
excel, i don't remember at the moment).

regards

Oliver

--
Oliver Albrecht
Albrecht Software Solutions

Remove the ns_ from the address before e-mailing.

Deborah Pate (TeamB)

unread,
Mar 17, 2003, 7:50:15 AM3/17/03
to
<<Mark Sandy:

As soon as I use OleContainer1.OleObject, I get an
exception 'Interface not supported'.
>>

You have to activate the object before accessing it:
Olecontainer.DoVerb(ovShow);

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html


0 new messages