[S] OLE embedding a graphsheet in a Visual Basic application

Nick Ellis (Nick.Ellis@cmis.csiro.au)
Thu, 19 Nov 1998 15:09:15 +1000


Splus version 4.5 for windows NT provides an example Visual Basic
application in SHOME/samples/oleauto/creatept that creates a simple line
plot (see code below). The object pGS of class "SPLUSGraphSheetFileType"
has a method CreatePlots that does the actual plotting. The program
works under Visual Basic 5.0, but I would like to take it further (eg
add a title, several lines, line styles etc). Unfortunately I cannot
find any documentation for this method or for the
SPLUSGraphSheetFileType class itself. I can examine the
SPLUSGraphSheetFileType class in the VB object browser, but the
CreatePlots method doesn't show up. Does anyone have any experience with
OLE embedding of graphsheets that you would be willing to share with me?

Regards,
Nick Ellis
CSIRO Marine Research mailto:Nick.Ellis@marine.csiro.au
PO Box 120 ph +61 (07) 3826 7260
Cleveland QLD 4163 fax +61 (07) 3826 7222
Australia http://www.marine.csiro.au

OLE1.CreateEmbed "", "SPLUSGraphSheetFileType"
Dim pGS As Object
Set pGS = OLE1.object
Dim pDataArray(1 To 100, 1 To 2) As Double
For i = 1 To 100
pDataArray(i, 1) = i
pDataArray(i, 2) = Sin(i)
Next i
Dim pColumnNameArray(1 To 2) As String
pColumnNameArray(1) = "x data"
pColumnNameArray(2) = "Sin(x) data"
bSuccess = pGS.CreatePlots("2D", "Line Plot", pDataArray,
pColumnNameArray)
-----------------------------------------------------------------------
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