subduco
10-15-2014, 08:05 PM
I borrowed/wrote code that generates cover letter slides from column A of a excel worksheet, then converts them to a PDF and saves them to a folder called Coverletters. Then it is supposed to combine a Main Cover Letter in the Hubs folder, with the sub-cover letter in the Coverletters folder, and a As-Built package PDF in the HPDocs folder, and lastly it combines a Contact information sheet at the end all into one PDF document.
This works on the first time around, it grabs all the right documents and combines them together and names the file correctly and everything. Now on the second time around, it will name the file correctly and generate the correct coverletter and place it as a PDF in the coverletters folder but it will not grab the right Main Cover letter PDF in the Hubs folder or the right As-Built document in the HPDocs folder etc., but when you open the document it is actually just the first document, duplicated twice. So if you have Node1 document with all of the Node1 files, then the second document will name itself Node2 (acquired from the second row of the excel worksheet column A) however it will just have all of Node1's files in it, twice. The third document will name itself correctly to Node3, but it will have all of Node1 files in it THREE times, the fourth document will name itself correctly but will have all of Node1's documents in it FOUR times and so on and so forth.
I do not understand why its not grabbing the right files after the first time through, and why it is duplicating the first nodes documents, but is generating the correct cover letters in the coverletter folder. Hopefully someone out there smarter then me (pretty much everyone) can lend some help. I been working at this all day and can't seem to get it, thanks in advance!
***Added the full code in two PNG attachments, would not let me post it all.
This works on the first time around, it grabs all the right documents and combines them together and names the file correctly and everything. Now on the second time around, it will name the file correctly and generate the correct coverletter and place it as a PDF in the coverletters folder but it will not grab the right Main Cover letter PDF in the Hubs folder or the right As-Built document in the HPDocs folder etc., but when you open the document it is actually just the first document, duplicated twice. So if you have Node1 document with all of the Node1 files, then the second document will name itself Node2 (acquired from the second row of the excel worksheet column A) however it will just have all of Node1's files in it, twice. The third document will name itself correctly to Node3, but it will have all of Node1 files in it THREE times, the fourth document will name itself correctly but will have all of Node1's documents in it FOUR times and so on and so forth.
I do not understand why its not grabbing the right files after the first time through, and why it is duplicating the first nodes documents, but is generating the correct cover letters in the coverletter folder. Hopefully someone out there smarter then me (pretty much everyone) can lend some help. I been working at this all day and can't seem to get it, thanks in advance!
***Added the full code in two PNG attachments, would not let me post it all.