I can't get this to work. My program fills all the values into an Excel spreadsheet- no problems there. What I'd like to do is a print preview/print function. I can't seem to get my code right, all I get are blank pages in the print preview box.
Expand|Select|Wrap|Line Numbers
- Dim oExcel As Object = CreateObject("Excel.Application")
- oExcel.Workbooks.Open("C:\DailyLogs\DailyLog.xlsx")
- PrintPreviewDialog1.Document = PrintDocument1
- PrintPreviewDialog1.ShowDialog()
- oExcel.Sheet1.PrintPreview()
Does anyone have any ideas? I've been up and down the internet with no luck.
Thanks