<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">Werner Pamler via Lazarus wrote:<br>
</div>
<blockquote
cite="mid:4bd599f6-7eba-826c-0c54-8273b926d047@freenet.de"
type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<blockquote cite="mid:57F4BFE2.8030206@avidsoft.com.hk"
type="cite"><font size="+1">I am having problem using the Type
Library generated.<br>
Don't know how to use it.<br>
<br>
I tried to 'learn' from old Delphi 5 source code (the only
version of Delphi I have) that worked with Excel 2000 but
found that the type library are so different from the one
generated by FPC.<br>
</font><br>
</blockquote>
I try to avoid that OLE stuff as much as possible - too much
pain... What is the reason why you want to control Excel? Maybe
you can achieve the same in a different way. If it's only reading
or writing files you should have a look a fpspreadsheet which
covers - I'd say - 90% of what is needed (this is not what Excel
offers - Excel has always offered more features than were needed).<br>
<br>
</blockquote>
I hate to use OLE as well but my customer needs to write his own
Excel spreadsheet formula and VBA routines etc and feed the results
every 5 minutes into my program and my program will execute some
tasks accordingly and write back the statuses to the Excel
spreadsheet. I tried to persuade him to learn pascal or a formal
programming language but he refused.<br>
<br>
By the way, I want to complain about OLE Automation. It must run in
the main thread. If I run it in an non-main thread even with
locking routine (coXXXX ) , it still crashes. I guess some deep down
routines in OLE just forget to make as thread safe.<br>
<blockquote
cite="mid:4bd599f6-7eba-826c-0c54-8273b926d047@freenet.de"
type="cite"> If you insist on Automation you should look at the
wiki articles <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://wiki.lazarus.freepascal.org/Office_Automation">http://wiki.lazarus.freepascal.org/Office_Automation</a>
and <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://wiki.lazarus.freepascal.org/ExcelAutomation/de">http://wiki.lazarus.freepascal.org/ExcelAutomation/de</a>
- the latter is in German, though.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
I tried fpspreadsheet but it does not support DDE which my customer
needs. Also, it does not support writing VBA.<br>
<br>
Dennis
</body>
</html>