+ Reply to Thread
Results 1 to 7 of 7

Do until file name is found in directory

  1. #1
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Do until file name is found in directory

    Hi All,
    I am having some trouble implementing some changes to a script I have found which prints a work sheet to a pdf printer. I have implemented a change, which saves the pdf under a name generated from the content of 2 cells. This change I have implemented fine. However now the code keeps getting stuck in a loop, here;

    Please Login or Register  to view this content.
    This line also does not fire correctly;
    Please Login or Register  to view this content.
    If there is a file already named the same it just skips over it and continues with the script regardless.

    I have stepped though both scripts adapted/non adapted and I just can't work out why its getting stuck in the loop.


    Please Login or Register  to view this content.
    Link to pdfcreator;
    http://sourceforge.net/projects/pdfcreator/

    Any help would be wonderful.

    Thanks!
    Attached Files Attached Files
    Last edited by beenbee; 07-28-2014 at 08:57 AM. Reason: add link to pdfcreator

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Do until file name is found in directory

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Do until file name is found in directory

    Thank you for the help! That has solved the loop issue and the rewriting of a new version over the same named pdf. However it isn't attaching the file to the email. I have been through and added the & ".pdf" file extention to all the places I feel I need it. Any ideas?
    Thank you

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Do until file name is found in directory

    try with
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Do until file name is found in directory

    Thank you for your response. Nope doesn't add the attachment. I tried just the sPDFName & ".pdf" and that doesn't add it either.

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Do until file name is found in directory

    I'm sorry, but I don't use Outlook, then I can not test the code.

  7. #7
    Forum Contributor
    Join Date
    10-07-2013
    Location
    Wilts, England
    MS-Off Ver
    Excel 2013
    Posts
    100

    Re: Do until file name is found in directory

    No problem, Thanks for the help. I'll post a new question.
    Thanks again.

+ 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. Need VBA code to search file in directory and sub-directory and show result
    By johnchencanada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2012, 11:13 PM
  2. Found Code to List All Folders and Size in Certain Directory. Need Help Editing.
    By jcranst in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2012, 03:11 PM
  3. Saving file in current directory after accessing file in another directory
    By vuxsa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2011, 11:37 AM
  4. Replies: 3
    Last Post: 06-11-2009, 07:08 PM
  5. File Not Found in correct directory, but able to read file name
    By googlebot in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-29-2008, 06:50 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