To open another workbook, you would use a statement like:
Workbooks.Open "full path and file name"
If you leave out the path, Excel looks only in the current directory.
On printing, you can record the command of changing the printer to a network
printer. That then makes it the active printer. I have heard that Excel
2002 and 2003 will allow some additional print commands such as setting
print trays, but I have not tested.
You can have lots of workbooks open when you run a macro. There is no
restriction. However, if you are opening up a workbook that is already
open, you are likely to get an error or lose data loaded into the workbook
if you reopen.
Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on
VB macros for Excel
"Andrew" wrote in message
...
Ladies & Gents,
I'm trying to make a macro to do a few tasks, and have come to a halt as I
can't seem to find an answer to my questions. I hope someone can help me
out.
I want this macro to do the following;
1) - Create a work list
2) - Use that list to open datasets with similar names, and save them as
excel reports (2 off for each name in the list)
3) - Open those reports & create an invoice for each name in the list
4) - Combine those invoices & the first list into one workbook
5) - Print the invoices, &
6) - Email some of the reports (the remainder go by snail-mail!)
At this point in time, I have code to write most of the macro, but I have
the following questions;
A) - How can I use the list to open other files & spreadsheets? I can add
sheets to a workbook using that list, but I can't seem to find a way to
use
the list to open new files.
B) - How do I send a page to print at a network printer, and to a
particular
tray? I can find code on printing sheets, but none seem to deal with IP
addresses or printer trays. And,
C) - Can I run the macro with 2 other workbooks open at the same time? It
seems like I can create the invoice workbook if I have the macro going,
open
up a report, and copy data to the invoice. But I've always been under the
impression that I can only have the macro & another workbook open at any
one
time.
Any help with these questions would be greatly appreciated.
TIA
Andrew.