I have a simple test application (one execute button) that opens an Excel
spreadsheet and then attempts to print the worksheet to a network printer.
When the application attempts to print the worksheet I receive the message:
"No printers are installed. To install a printer, point to Settings..."
Since this application is running on my machine I made sure my machine had a
default printer defined. But this still didn't fix the problem. Has anyone
else seen this problem? I am attaching my code below:
Dim objApp As Excel.Application
Dim objBook As Excel._Workbook
Dim objBooks As Excel.Workbooks
Dim objSheets As Excel.Sheets
Dim objSheet As Excel._Worksheet
Dim range As Excel.Range
objApp = New Excel.Application
'objApp.ActivePrinter = ps.PrinterName
objBooks = objApp.Workbooks
objBook = objBooks.Open("C:\Inetpub\wwwroot\report0.xls")
objSheets = objBook.Worksheets
'objApp.Worksheets.PrintOut()
objSheets.PrintOut()
objBooks.Close()
Thanks for any help.