Article View: borland.public.cppbuilder.migration
Article #220EOleSysError Exception with Invalid Argument Type
From: Fritz
Date: Sun, 18 Nov 2007 10:49
Date: Sun, 18 Nov 2007 10:49
26 lines
2107 bytes
2107 bytes
Hello,
I'm just migrating from BCB5 to BCB6. When I compile and run
applications that use OLE automization (MS Word or MS Excel), I get an
EOleSysError Exception when opening a document or a worksheet, telling
that an invalid argument type is used. In both cases, the arguments are
AnsiStrings, which used to be valid and works fine with BCB5.
The coding is:
(Word2000)
AnsiString slDocument =
"e:\\Programme\\Borland\\CBuilder5\\Projects\\worda\\tweaksnq.doc";
Variant vOLEWord = CreateOleObject("Word.Application");
Variant vDocuments = vOLEWord.OlePropertyGet("Documents");
Variant vWDocument = vDocuments.OleFunction("Open", slDocument);
(Excel97)
String excelWorkbook = FileListBox1->FileName;
Variant var_mExcel=CreateOleObject("Excel.Application");
Variant var_mBook = var_mExcel.OlePropertyGet("Workbooks")
.OlePropertyGet("Open", excelWorkbook);
Searching the WEB, I found some incidents describing similar problems,
but no solution (althoug when changing slDocumnents to slDocuments.c_str()).
Any idea? Regards, Fritz
p.s.: If this is the wrong forun for my problem, please let me know.
Technical Details
Message-ID:
<474018c1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 110f51,c92abc47d500c713,start X-Google-Attributes: gid110f51,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 18 Nov 2007 11:49:32 +0100 From: Fritz <fh.mueller@congstar.de> User-Agent: Thunderbird 1.5.0.13 (Windows/20070809) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.migration Subject: EOleSysError Exception with Invalid Argument Type Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 84.133.26.226 Message-ID: <474018c1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195382977 84.133.26.226 (18 Nov 2007 02:49:37 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail