| | |
How do I PrintPrintPreview an Excel File?
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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
- Unable to create an excel file in VB.net (VB.NET)
- Manipulate Excel file using C++?? (C++)
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- 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
| Thread Tools | Search this Thread |
"crystal 2.0 2007 2008 access advanced application asp asp.net basic beginner binary bing c# code connectionstring control convert crystalreport cuesent dataanalysis database datagrid datagridview dataset eclipse editing equipt excel expose firewall folder ftp function google images infiniteloop inline 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






