| | |
How do I PrintPrintPreview an Excel File?
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2009
Posts: 94
Reputation:
Solved Threads: 6
How do I Load an excel file to the PrintPreviewDialog?
Error states that excel cannot be converted to .Document.
vb Syntax (Toggle Plain Text)
Imports Excel = Microsoft.Office.Interop.Excel Private Sub btnPrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrintPreview.Click Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook xlApp = New Excel.ApplicationClass xlWorkBook = xlApp.Workbooks.Open(Application.StartupPath & "report_summary.xlsx") MyPrintPreviewDialog.Document = xlWorkBook If MyPrintPreviewDialog.ShowDialog() = DialogResult.OK Then xlWorkBook.Close() xlApp.Quit() End If End Sub
Error states that excel cannot be converted to .Document.
![]() |
Similar Threads
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- Unable to create an excel file in VB.net (VB.NET)
- Manipulate Excel file using C++?? (C++)
- read excel records in asp not refreshing (is the excel file cached) (ASP)
- grabbing source from excel file (was: please, somebody help me!!!) (Visual Basic 4 / 5 / 6)
Other Threads in the VB.NET Forum
- Previous Thread: visual studio 2008 vb
- Next Thread: printing document
Views: 629 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for excel, printpreview, vb.net
"crystal 2.0 2007 2008 access advanced application asp asp.net automation basic beginner binary bing c# class code connectionstring control convert crystalreport cuesent dataanalysis database datagrid datagridview dataset eclipse editing equipt excel expose firewall folder ftp function google images infiniteloop inline installer looping map memory microsoft mobile movingranges ms networking objects open password picturebox plugin plugins port powerpoint ppc printing printpreview problem project prompt python range-objects relationaldatabases report reports" save savedialog search settings shutdown soap socket sql sqldatbase sqlserver2005 subroutine subscription tcp textbox unicode vb vb.net vba view visual visualbasic visualbasic.net visualstudio visualstudio.net wizard word xlwt






