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

Lee Edlefsen (
Thu, 10 Sep 1998 11:15:26 -0700


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

>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, wrote:
>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 <- pExcel, list( visible=T ) )
>pWorkBooks <- 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
>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.
>This message was distributed by To unsubscribe
>send e-mail to with the BODY of the
>message: unsubscribe s-news
This message was distributed by To unsubscribe
send e-mail to with the BODY of the
message: unsubscribe s-news