Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-08

New version of Excel Interface unit available

8 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thierry Coq

A new version of ExcelInterface is now available (version 0.4) here:

http://tcoq.free.fr/composants.html

It's provided as is, under the MPL 1.1 license.

This is unfinished work, but the version 0.4 has the minimum necessary to do
useful stuff with the interface, and more:
- creating and loading excel workbooks,
- saving workbooks,
- creating and accessing sheets,
- getting values and setting values (and formulas) in cells,
- getting and changing cell format
- creating comments,
- creating shapes,
- creating charts.

There is no user manual, but the test example in the Tests directory provides an example
for each function, so it should be easy to use. In addition, Excel' VB documentation should
be also very useful.

It provides a very clear demonstration COM programming (although a manual activity) is entirely possible in FPC 2.2.4 and Lazarus.

All comments and suggestions are welcome.

Best regards,
Thierry

Reply by email

Leslie Kaye
to Thierry Coq
Thierry Coq wrote
<div class="moz-text-flowed" style="font-family: -moz-fixed">A new version of ExcelInterface is now available (version 0.4) here:

Tip for a basic and simple solution (Windows but presumably similar on other platforms?) you can just write your data to a Comma Separated Variable (csv) text file and do a ShellExecute 'open' on it. This will open it in whatever the user's favourite spreadsheet application is. Windows unfortunately might open it in NotePad in which case you just need to change the csv default application to Excel, OO Calc, Quattro Pro or whatever.

</div>

Reply by email

Žilvinas Ledas
to Leslie Kaye
other platforms?) you can just write your data to a Comma Separated Variable (csv) text file and do a ShellExecute 'open' on it. This will

Maybe it will help someone: one can write xml file and rename it to .xls and excel will open it without any difference ;)
To know the right xml format one can just save any xls file as xml (using Excel > Save as option) and look at the xml tags :) This enables to generate formatting, filtering and other "special features".

Reply by email

Felipe Monteiro de Carvalho
to Leslie Kaye: Tip for a basic and simple solution (Windows but presumably similar on other platforms?)…
Leslie Kaye wrote
Tip for a basic and simple solution (Windows but presumably similar on other platforms?) you can just write your data to a Comma Separated Variable (csv) text file and do a ShellExecute 'open' on it.

Or you can generate a spreadsheet with the fpspreadsheet library:

http://wiki.lazarus.freepascal.org/FPSpreadsheet

Felipe Monteiro de Carvalho

Reply by email

Thierry Coq
to Felipe Monteiro de Carvalho

Yes, there are several alternatives now to read/write spreadsheets: a) - using CSV files,
b) - using XML files,
c) - using FPSpreadsheet,
d) - now using ExcelInterface.

Unlike a) and b) ExcelInterface controls Excel directly using the COM interface, so the interaction with the Excel program is immediate: formulas can be written and and evaluated automatically by the Excel solver, the user can input data with Excel filled-in spreadsheets, the format itself is rendered immediately, moving shapes also move connectors automatically. It also requires less manual work from the end-user.

Unlike c) ExcelInterface provides many additional facilities in addition to the cells and values: formulas, formats, comments, shapes, diagrams, etc. and works on many Excel versions.

ExcelInterface brings the power of Excel to FPC and Lazarus as a sort of additional external component.

In the future, I hope to add a similar interface to link to OpenOffice, so as:
- to have the same interface to generate either OpenOffice or Excel spreadsheets,
- to be able to run the interface on Linux.

Enjoy!
Thierry

Felipe Monteiro de Carvalho wrote 13 lines
On Wed, Aug 26, 2009 at 6:55 AM, Leslie Kaye wrote: > Tip for a basic and simple solution (Windows but presumably similar on other > platforms?) you can just write your data to a Comma Separated Variable (csv) > text file and do a ShellExecute 'open' on it. > Or you can generate a spreadsheet with the fpspreadsheet library: http://wiki.lazarus.freepascal.org/FPSpreadsheet

Reply by email

Luiz Americo Pereira Camara
to Thierry Coq: Yes, there are several alternatives now to read/write spreadsheets: d) - now using…
Thierry Coq wrote 26 lines
Yes, there are several alternatives now to read/write spreadsheets: a) - using CSV files, b) - using XML files, c) - using FPSpreadsheet, d) - now using ExcelInterface. Unlike a) and b) ExcelInterface controls Excel directly using the COM interface, so the interaction with the Excel program is immediate: formulas can be written and and evaluated automatically by the Excel solver, the user can input data with Excel filled-in spreadsheets, the format itself is rendered immediately, moving shapes also move connectors automatically. It also requires less manual work from the end-user. Unlike c) ExcelInterface provides many additional facilities in addition to the cells and values: formulas, formats, comments, shapes, diagrams, etc. and works on many Excel versions. ExcelInterface brings the power of Excel to FPC and Lazarus as a sort of additional external component. In the future, I hope to add a similar interface to link to OpenOffice, so as: - to have the same interface to generate either OpenOffice or Excel spreadsheets, - to be able to run the interface on Linux.

There's http://sourceforge.net/projects/uno-pas-bridge/ . The svn version is running under Linux and Windows. What's missing is updated instruction how to install on Linux and Windows since is not straight

Luiz

Reply by email