+ Reply to Thread
Results 1 to 1 of 1

Batch print protected PDF files

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    Tokyo, Japan
    MS-Off Ver
    Office 2007
    Posts
    26

    Batch print protected PDF files

    I need to batch print protected PDF files returned by teachers. I currently have a VBA programs that does this for the original Excel files.

    But as I want to send PDF instead, once they return protected, I hope to be able to alter the current VBA to print the PDF files.
    1. I want to open and print the PDF based upon the file name
    2. I would like to print only the first page.

    I have included the VBA to print the original Excel files, but now wish to print PDF files instead

    Sub PrintWorkbooks()
    Dim cell, rng As Range
    Dim wb_loc, wb_name, wb_ext, wb_pw As String
    Dim wkbk As Workbook

    wb_loc = "\\xxxx\JP-DFS-200\BVC\BVC\Freelance\Signed\"
    wb_ext = ".xl*"
    Set rng = Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
    For Each cell In rng
    wb_name = cell.Value
    wb_pw = cell.Offset(0, 1).Value
    If Dir(wb_loc & wb_name & wb_ext) <> "" Then
    Set wkbk = Workbooks.Open(Filename:=wb_loc & wb_name & wb_ext, Password:=wb_pw)
    Sheets("Invoice").PrintOut Copies:=1
    wkbk.Close SaveChanges:=False
    End If
    Next cell
    End Sub

    The passwords are held on an excel sheet in the workbook with *filename*.* in a list.

    A: Sheetfilename*.* B: corresponding PW
    Last edited by mark1955; 07-22-2019 at 11:27 PM. Reason: Change of approach

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Transferring Word Form Fields to Excel With Formatting
    By Ppubz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2014, 10:03 AM
  2. [SOLVED] Transferring data from one sheet to another just by adding a count.
    By Islandsmgr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2014, 12:51 AM
  3. populating list boxes and combo boxes in a user form.
    By ahceinaej in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2014, 11:54 AM
  4. Transferring form data to database, excel 2007
    By Tylermatt86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2013, 03:06 PM
  5. Transferring variable data from worksheet to form
    By RossN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-08-2012, 12:23 AM
  6. User Form List Boxes and Adding and Deleting Data
    By learning_vba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2010, 06:23 PM
  7. [SOLVED] Transferring information from one user form to another
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2006, 06:55 PM

Tags for this Thread

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