How do I Load an excel file to the PrintPreviewDialog?
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.