Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitlePrint an Excel worksheet displayed in an OLE container object
DescriptionThis 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.
KeywordsOLE, print, Excel, OLE container
CategoriesGraphics, 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated