+ Reply to Thread
Results 1 to 7 of 7

loop trough all folders and subfolders and merge pdf files

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    loop trough all folders and subfolders and merge pdf files

    Hi all,

    I found the below code:
    Please Login or Register  to view this content.
    on this link:
    http://khkonsulting.com/2009/03/adob...-introduction/

    I need to adjust it to get the path of the file from excel sheet, starting at row 2 and down. It is possible that it will have only a few or a lot and with different names.

    how to create a loop that will set the part 1, part 2 and so on depending on how many files there are in the folder and subfolders.
    and, the maybe harder part would be to add also the names of the files as bookmarks in the merged pdf file.

    greetings.
    Last edited by Megatronixs; 10-23-2018 at 09:49 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: loop trough all folders and subfolders and merge pdf files

    Please Login or Register  to view this content.
    codeBtweenCode.jpg
    Last edited by davesexcel; 10-23-2018 at 08:47 AM.

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: loop trough all folders and subfolders and merge pdf files

    fixed, no clue what happened.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: loop trough all folders and subfolders and merge pdf files

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  5. #5
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: loop trough all folders and subfolders and merge pdf files

    Hi,

    this is locked at our work, I'm not able to upload things :-(

    all it comes down that the one macro gets all the pdf files in a folder and list them on a sheet. Then I want to pass it as this part, but it needs to loop trough them:
    Please Login or Register  to view this content.
    Greetings.

  6. #6
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: loop trough all folders and subfolders and merge pdf files

    Hi all,

    I found some other code that works fine too, but I get stuck on the array part :-(

    This is the code that is almost working now:

    Please Login or Register  to view this content.
    The "myArray" is the part that actually does not build up the array and then the merge pdf files is empty and stops.

    Any way to find the error above?

    Greetings.

  7. #7
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: loop trough all folders and subfolders and merge pdf files

    ok, so the problem here is that the array has an extra blank value at the end. this causes the pdf merging to fail.
    how to get rid of this extra blank value there?

    Greetings.

+ 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. VBA code to loop through folders and subfolders under date time conditions ?
    By hopeful_positive in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2018, 11:45 AM
  2. how to copy and paste folders / subfolders and files
    By ColemanJames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2018, 07:32 PM
  3. Loop through folders and subfolders - Tweaking existing code
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-29-2016, 09:20 AM
  4. [SOLVED] Search for files in folders and subfolders
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 08:43 AM
  5. Loop trough all folders and subfolders and copy data
    By forfiett in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 10:22 AM
  6. Map/List of folders, subfolders & files
    By Bogdan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2006, 01:10 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