Re: [S] Loading Excel *.xla from Splus.

Lee Edlefsen (leee@statsci.com)
Thu, 10 Sep 1998 11:15:26 -0700


John,

I passed this on to one of our developers, Chris Disdero, and here is his
response:

>RunAutoMacros is simply a method of a workbook, according to Excel on-line
>help. So, you should simply be able to call this method on the pNewBook2
>pointer you obtained in the S-PLUS script:
>
>xlAutoOpen <- 1
>xlAutoOpen <- 2
>xlAutoActivate <- 3
>xlAutoDeactivate <-4
>call.ole.method( pNewBook, "RunAutoMacros", xlAutoOpen )
>
>Note that the numeric values of the constants were obtained by using the VB
>object browser on Excel constants.

Hope this helps,

Lee Edlefsen
VP of Development

At 04:33 PM 9/8/98 +0100, John.Gavin@wdr.com wrote:
>Hi,
>
>I want to use Splus to load and execute an excel *.xla file
>(to make some user defined excel functions visible to Splus).
>
>The following code loads the file but doesnt execute it
>
>pExcel <- create.ole.object( "excel.application" )
>pVisible <- set.ole.property( pExcel, list( visible=T ) )
>pWorkBooks <- get.ole.property( pExcel, "workbooks" ) [[1]]
>pNewBook2 <- call.ole.method( pWorkBooks , "Open", "c:\\temp\\book.xla")
>
>The VBA equivqlent of what I think I need to tell Excel is
>
>Workbooks.Open(Filename:="c:\\temp\\book.xla").RunAutoMacros
Which:=xlAutoOpen
>
>but I cant see how to do this using SPlus.
>
>I have looked in splus4\samples\oleauto\splus
>and the programmer's guide chp 15 without success.
>
>I am on NT4.0 with SPlus 4.5 Professional Release 2.
>
>Thanks,
>
>John.
>
>-----------------------------------------------------------------------
>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
>
-----------------------------------------------------------------------
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