+ Reply to Thread
Results 1 to 4 of 4

Adding files to a print queue

  1. #1
    Brad
    Guest

    Adding files to a print queue

    Hello, I have end users who have to print a lot of contracts through excel.
    What they are wanting to do is add the contracts to a sort of print queue.
    (that way they can print all files at once) My thought is to have a seperate
    file (based on the users name) updated anytime the user wants to add the file
    to the queue. In the file would just be a list of file names underneath the
    "A" Column. Then, when the user wants to print from the queue they would be
    able to hit one button and all the files in the queue would be sent to the
    printer. I have a macro that I would want it to run since it prints out the
    necessary pages from each file. So my questions are: Can VBA select and print
    files from a list of names from one spreadsheet and then loop through each
    name/file and print in order with running my "finalize" macro?

    Thanks for any given help!

  2. #2
    Tom Ogilvy
    Guest

    Re: Adding files to a print queue

    Dim sh as Worksheet
    Dim rng as Range
    Dim bk as Workbook
    Dim cell as Range
    set sh = Workbooks("List.xls").Worksheets("Sheet1")

    set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))

    for each cell in rng
    set bk = Workbooks.Open(cell.name)
    ' bk is now the activeworkbook, so run you macro
    ' macro that prints
    bk.close Savechanges:=False
    Next

    --
    Regards,
    Tom Ogilvy


    "Brad" <[email protected]> wrote in message
    news:[email protected]...
    > Hello, I have end users who have to print a lot of contracts through

    excel.
    > What they are wanting to do is add the contracts to a sort of print queue.
    > (that way they can print all files at once) My thought is to have a

    seperate
    > file (based on the users name) updated anytime the user wants to add the

    file
    > to the queue. In the file would just be a list of file names underneath

    the
    > "A" Column. Then, when the user wants to print from the queue they would

    be
    > able to hit one button and all the files in the queue would be sent to the
    > printer. I have a macro that I would want it to run since it prints out

    the
    > necessary pages from each file. So my questions are: Can VBA select and

    print
    > files from a list of names from one spreadsheet and then loop through each
    > name/file and print in order with running my "finalize" macro?
    >
    > Thanks for any given help!




  3. #3
    Brad
    Guest

    Re: Adding files to a print queue

    Thanks Tom,

    Another question. These files will be in different folders. Would it be
    better to have the "List.xls" file reference the full path and name of the
    file into the cell? If so, how would I do this? Thanks.

    "Tom Ogilvy" wrote:

    > Dim sh as Worksheet
    > Dim rng as Range
    > Dim bk as Workbook
    > Dim cell as Range
    > set sh = Workbooks("List.xls").Worksheets("Sheet1")
    >
    > set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))
    >
    > for each cell in rng
    > set bk = Workbooks.Open(cell.name)
    > ' bk is now the activeworkbook, so run you macro
    > ' macro that prints
    > bk.close Savechanges:=False
    > Next
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Brad" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello, I have end users who have to print a lot of contracts through

    > excel.
    > > What they are wanting to do is add the contracts to a sort of print queue.
    > > (that way they can print all files at once) My thought is to have a

    > seperate
    > > file (based on the users name) updated anytime the user wants to add the

    > file
    > > to the queue. In the file would just be a list of file names underneath

    > the
    > > "A" Column. Then, when the user wants to print from the queue they would

    > be
    > > able to hit one button and all the files in the queue would be sent to the
    > > printer. I have a macro that I would want it to run since it prints out

    > the
    > > necessary pages from each file. So my questions are: Can VBA select and

    > print
    > > files from a list of names from one spreadsheet and then loop through each
    > > name/file and print in order with running my "finalize" macro?
    > >
    > > Thanks for any given help!

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Adding files to a print queue

    Of course you would need to provide all the information to access the file
    in each cell.

    For example in A1 I would type

    "C:\MyFolder\MySubFolder\Myfile.xls"

    --
    Regards,
    Tom Ogilvy

    "Brad" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Tom,
    >
    > Another question. These files will be in different folders. Would it be
    > better to have the "List.xls" file reference the full path and name of the
    > file into the cell? If so, how would I do this? Thanks.
    >
    > "Tom Ogilvy" wrote:
    >
    > > Dim sh as Worksheet
    > > Dim rng as Range
    > > Dim bk as Workbook
    > > Dim cell as Range
    > > set sh = Workbooks("List.xls").Worksheets("Sheet1")
    > >
    > > set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))
    > >
    > > for each cell in rng
    > > set bk = Workbooks.Open(cell.name)
    > > ' bk is now the activeworkbook, so run you macro
    > > ' macro that prints
    > > bk.close Savechanges:=False
    > > Next
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Brad" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hello, I have end users who have to print a lot of contracts through

    > > excel.
    > > > What they are wanting to do is add the contracts to a sort of print

    queue.
    > > > (that way they can print all files at once) My thought is to have a

    > > seperate
    > > > file (based on the users name) updated anytime the user wants to add

    the
    > > file
    > > > to the queue. In the file would just be a list of file names

    underneath
    > > the
    > > > "A" Column. Then, when the user wants to print from the queue they

    would
    > > be
    > > > able to hit one button and all the files in the queue would be sent to

    the
    > > > printer. I have a macro that I would want it to run since it prints

    out
    > > the
    > > > necessary pages from each file. So my questions are: Can VBA select

    and
    > > print
    > > > files from a list of names from one spreadsheet and then loop through

    each
    > > > name/file and print in order with running my "finalize" macro?
    > > >
    > > > Thanks for any given help!

    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1