Lisp HUG Maillist Archive

Examples of using LWW COM to drive MS Excel or similar?

I'm about to look into getting data from a LWW session into Excel using 
the COM support in 4.2
Does anyone have any examples of doing this, or something similar, that 
they are prepared to share?  I looked at, but didn't use, the low-level 
COM stuff ages ago and have forgotten most of it. Looking at a working 
example would shorten my learning curve significantly.

-- 
Thanks
Guy.


Re: Examples of using LWW COM to drive MS Excel or similar?

: Examples of using LWW COM to drive MS Excel or similar?

Guy,

Is it important that you use COM? Excel 2002 (and only that version) imports
files formatted in XML Speadsheet Language. The specification is available
at:
http:// msdn.microsoft.com/ library/ en-us/ dnexcl2k2/ html/ odc_xmlss.asp

For example, let's say that you want to send something like
Contents of cell 1:    1
Contents of cell 2:    2
Contents of cell 3:    3
Contents of cell 4:    6  (computed as the sum of cells 1 to 3)


you should generate a file (with the .xml suffix):


< header information skipped>


<Worksheet ss:Name="Sheet1">
- <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="4"
x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="13.2">
- <Row>
- <Cell>
  <Data ss:Type="Number">1</Data>
  </Cell>
  </Row>
- <Row>
- <Cell>
  <Data ss:Type="Number">2</Data>
  </Cell>
  </Row>
- <Row>
- <Cell>
  <Data ss:Type="Number">3</Data>
  </Cell>
  </Row>
- <Row>
- <Cell ss:Formula="=SUM(R[-3]C:R[-1]C)">
  <Data ss:Type="Number">6</Data>
  </Cell>
  </Row>
  </Table>
- <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">


<footer material goes here>

 I know that there are a number of ambiguities here and there
(Type="Number"), but it's one more option.


Re: Examples of using LWW COM to drive MS Excel or similar?

Guy Footring <Guy@Footring.demon.co.uk> writes:

> I'm about to look into getting data from a LWW session into Excel
> using the COM support in 4.2
> Does anyone have any examples of doing this, or something similar,
> that they are prepared to share?  I looked at, but didn't use, the
> low-level COM stuff ages ago and have forgotten most of it. Looking
> at a working example would shorten my learning curve significantly.

I've recently written some code that uses Lispwork's DDE support to
connect to Excel and fill a spreadsheet. Very basic stuff but it does
what it's supposed to do. Let me know if you want it.

Cheers,
Edi.


Updated at: 2020-12-10 09:00 UTC