borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (DOS PRINTING IN VB)Next Topic (I need to print a word document in VB properly) New Topic New Poll Post Reply
AndreaVB Forum : Printing : How to print a spreadsheet using VB?
Poster Message
Swing5
Level: Guest


icon How to print a spreadsheet using VB?

Guys,
         Please do give me an example on how to print a spreadsheet or an xls file in VB,

Thanks

08-03-2003 at 08:00 AM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: How to print a spreadsheet using VB?

Try this
Don't forget the reference

Private Sub Command1_Click()

    Dim xlapp As Excel.Application
    
    Set xlapp = New Excel.Application
    
    xlapp.Workbooks.Add "c:xlfile.xls"

    xlapp.Worksheets.PrintOut
    
    xlapp.Quit
    
    Set xlapp = Nothing
    
End Sub

23-04-2003 at 02:34 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Printing : How to print a spreadsheet using VB?
Previous Topic (DOS PRINTING IN VB)Next Topic (I need to print a word document in VB properly) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder