Printing in Excel from VB2005

cjohnson

Well-known member
Joined
Sep 21, 2006
Messages
63
Location
WV
Programming Experience
1-3
I am writing a program in VB2005 which opens an existing Excel file, updates the worksheets, and prints some of the sheets. I have two problems. First, I can call Excels print command with a specific printer, but I would like to be able to open Excels print dialog so other users can choose an appropriate printer. I have tried VB's printdialog, and I can select a printer, but I can't get the string with the printer name to pass to Excel's print command.
Second, I can select multiple sheets from Excel VBA with
VB.NET:
Sheets(Array("Sheet1", "Sheet2")).Select
However, in VB2005, I get the error that Array is a type. How can I select multiple sheets to print?
Any help would be greatly appreciated.
 
I have found Excels Print Dialog in Application.Dialogs, but I still need to find how to select multiple worksheets.
Thanks.
 
Back
Top