+ Reply to Thread
Results 1 to 4 of 4

Loop through all files in folder

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Loop through all files in folder

    This code opens a PDF file and copies the contents to an excel worksheet.

    The code works with one file, I am trying adapt the code to loop through all files in the folder, copying each file into its own worksheet, without any success.

    Ideally I would like to close the PDF file before opening the next one.

    Any suggestions?




    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Loop through all files in folder

    I have managed to get my code to:
    Loop through all the files
    Open each file
    Add a worksheet for each file

    BUT...the code only copies the very last file, all the other sheets are blank.

    I am thinking that if I can close each PDF after copying then my code might work?
    Any assistance appreciated.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Loop through all files in folder

    I should also add, that the code is selecting the data from each of the PDF files, it is just not copying the data to the worksheet except for the very last file.

  4. #4
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Loop through all files in folder

    Not possible?
    Too hard?

+ 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. loop through selected files in folder
    By OWA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2013, 11:10 AM
  2. VBA Loop for a folder of all the files, Loop all the worksheet in each workbook
    By nanjingwoodworking in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2013, 07:20 PM
  3. Loop between 2 files in a folder
    By jharaldson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2013, 02:33 AM
  4. loop through all files in a folder except for one of them
    By masben in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2013, 10:23 AM
  5. Loop through files in a folder
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2010, 06:03 PM

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