[19171] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] OLE automation headaches

daemon@ATHENA.MIT.EDU (Michael Conklin)
Thu Sep 9 12:17:32 1999

Message-Id: <99Sep9.111113cdt.115207@gateway.cresearch.com>
Date: Thu, 9 Sep 1999 11:11:37 -0500
From: "Michael Conklin" <mconklin@customresearch.com>
To: <s-news@wubios.wustl.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline


In my OLE automation experiments I want to write data into an excel
spreadsheet and format the text, column width etc.  So far I can get the
data in okay but formating is proving to be a problem.

I can access the styles property of the workbook with

pStyle<-get.ole.property(pWorkbook,"Styles")

Then I can access properties of the styles collection such as the Count
property which tells how many styles are in the collection.

stylecount<-get.ole.property(pStyle[[1]],"Count")$Count

which gives me 6

The property I need to access is the Item property, but the Excel
documentation seems to indicate that you need to access a specific index
number for this (Excel documentation says the property is referenced as
Item(Index)

There does not appear to be a way to have get.ole.property pass both a
property name and an index to Excel. If I use:

get.ole.property(pStyle[[1]],"Item") I get an error saying that the
number of items is different from the amount expected by the property.
(I don't know if this is when it is passed to Excel or when Excel passes
it back but I believe it is the former).  If I try to embed the index
like get.ole.property(pStyle[[1]],"Item(1)") then it doesn't recognize
the property request at all.  Are there any other ole functions or will
I have to roll my own?



****************************************
Michael Conklin
VP Analytic Services
Custom Research Inc.
8401 Golden Valley Rd
Minneapolis, MN 55427
mconklin@customresearch.com
612-542-0821 (Voice)
612-542-0864 (Fax)
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post