Hello!
Im using VB.NET and office XP. When I try to print a worksheet I get the following error:
"Exception from HRESULT : 0x800A03EC"
The code I use is:
Dim excelApp As New Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Open("C:\ClinicTech\Files\1.xls")
Dim excelWorksheet As Excel.Worksheet = CType(excelBook.Worksheets(1), Excel.Worksheet)
Makes Excel invisible to the user until spreadsheet is populated
excelApp.Visible = False
With excelWorksheet
Populate Excel spreadsheet
Try
.Range("E7").Value = iBPD
Catch ex As Exception
MsgBox(ex.Message)
End Try
Make Excel visible
excelApp.Visible = True
excelApp.Sheets.Select("Graph")
excelApp.Sheets.PrintOut()
End With
Thanks!
Tom.
Im using VB.NET and office XP. When I try to print a worksheet I get the following error:
"Exception from HRESULT : 0x800A03EC"
The code I use is:
Dim excelApp As New Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Open("C:\ClinicTech\Files\1.xls")
Dim excelWorksheet As Excel.Worksheet = CType(excelBook.Worksheets(1), Excel.Worksheet)
Makes Excel invisible to the user until spreadsheet is populated
excelApp.Visible = False
With excelWorksheet
Populate Excel spreadsheet
Try
.Range("E7").Value = iBPD
Catch ex As Exception
MsgBox(ex.Message)
End Try
Make Excel visible
excelApp.Visible = True
excelApp.Sheets.Select("Graph")
excelApp.Sheets.PrintOut()
End With
Thanks!
Tom.