|
|
Title | Print an Excel worksheet displayed in an OLE container object |
Description | This example shows how to print an Excel worksheet displayed in an OLE container object in Visual Basic 6. It calls the object's ActiveSheet.PrintOut method, passing it parameters to control the printing. |
Keywords | OLE, print, Excel, OLE container |
Categories | Graphics, Software Engineering |
|
|
When the user clicks the Link button, the cmdLink_Click event handler links the OLE object to the indicated file.
When the user clicks the Print button, the program calls the OLE object's ActiveSheet.PrintOut method, passing it parameters to control the printing. The Excel server does all the work.
|
|
Private Sub cmdLink_Click()
OLE1.CreateLink txtObject.Text
End Sub
Private Sub cmdPrint_Click()
OLE1.Object.ActiveSheet.PrintOut Copies:=1, _
Collate:=True
End Sub
|
|
|
|
|
|