+ Reply to Thread
Results 1 to 5 of 5

Create PDF with dynamic file path

  1. #1
    Registered User
    Join Date
    06-22-2018
    Location
    suisse
    MS-Off Ver
    office 2016
    Posts
    59

    Create PDF with dynamic file path

    Hello,
    I have found this code on the web but still can't seem to find a solution to this,
    I want to create a pdf file with the filepath based on userform captions or sheets values like you can seen bellow but i can't seem to make it work and i don't know what i'm doing wrong.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Create PDF with dynamic file path

    Without seeing the file or knowing the error you are getting?
    What happens when you use this?
    Please Login or Register  to view this content.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Create PDF with dynamic file path

    Please Login or Register  to view this content.
    do these give the expected results

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Create PDF with dynamic file path

    It could be either of the two problems addressed.

    1. The code is not in the Userform object and or the control objects reference names don't exist.
    a. I seldom find need for Me.

    2. Your pdf filename is not valid/legal.
    a. MsgBox() is fine for debugging. I normally use Debug.Print and view a Run's result in VBE's Immediate Window.
    b. Just because you create a drive:\path\filename.ext does not mean that the drive:\path exists nor that it uses valid characters and does not exceed character limits. Date strings can often cause this sort of problem. e.g. 8/30/2018

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Create PDF with dynamic file path

    Works here in a mock up
    Attached Files Attached Files

+ 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. [SOLVED] Using dynamic file path instead of hard-coded
    By robbo1172 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-20-2018, 08:58 AM
  2. INDEX with dynamic File Path String
    By kikinana123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2016, 01:38 PM
  3. Macro to save sheet as CSV using a dynamic file name and file path
    By chris.tinta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 10:45 AM
  4. Dynamic file path
    By GaidenFocus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2011, 12:57 PM
  5. Macro to check dynamic file path and create if does not exist
    By Matso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2011, 01:56 AM
  6. Dynamic path for a file used in the vbscript
    By mosu90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2008, 04:24 AM
  7. Use String Variables in File Path and create path if not existing
    By JanBang in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2007, 09:04 AM

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