C
Carl Wolter
Hello,
I am using VB .Net 2003 to automate Excel and Word as
part of a larger project I am working on. I need to give
users the option of printing to different network
printers. I have a PrintDialog box that stores the current
user choices in PrintDocument1. Before I start to printout
the Excel and Word files I have the following code..
objword.ActivePrinter=
PrintDocument1.PrinterSettings.PrinterName
objexcel.ActivePrinter =
PrintDocument1.PrinterSettings.PrinterName
The Word automation will print correctly to the user
defined printer.
The Excel line however returns
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
Any ideas?
Carl Wolter
I am using VB .Net 2003 to automate Excel and Word as
part of a larger project I am working on. I need to give
users the option of printing to different network
printers. I have a PrintDialog box that stores the current
user choices in PrintDocument1. Before I start to printout
the Excel and Word files I have the following code..
objword.ActivePrinter=
PrintDocument1.PrinterSettings.PrinterName
objexcel.ActivePrinter =
PrintDocument1.PrinterSettings.PrinterName
The Word automation will print correctly to the user
defined printer.
The Excel line however returns
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
Any ideas?
Carl Wolter