+ Reply to Thread
Results 1 to 7 of 7

Save excel file in pdf in specific location.

  1. #1
    Registered User
    Join Date
    08-11-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    7

    Save excel file in pdf in specific location.

    Sir,

    Please help me to solved the issues .When I run the macro its showing "run time error 5 or invalid procedure or call argument.

    I want save the file in PDF in specific location,my code is given below.

    Sub saveinvoice()
    Sheet2.Range("A1:l57").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\USER\Desktop\inventory\" & Sheet2.Range("j11").Value & ".pdf", openafterpublish:=True
    End Sub

    Regards
    Manoj

  2. #2
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Save excel file in pdf in specific location.

    I tried your code, it is working well. There is an error in your Filename (C:\Users\USER\Desktop\inventory\), remove the last slash.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Save excel file in pdf in specific location.

    Code looks fine, cannot replicate same error

    two things to check
    is your Directory accurate and you have write access?
    is the value in J11 a filename of which Windows allows?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Save excel file in pdf in specific location.

    two things to check
    is your Directory accurate and you have write access?
    is the value in J11 a filename of which Windows allows?
    One other - what version of Excel do you have? The creation of PDF was introduced with Excel 2007 so the functionality won't work on Excel 2003 and earlier (though I doubt that's the issue to be honest but just good to rule it out).
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    08-11-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    7

    Re: Save excel file in pdf in specific location.

    Chandy,

    I removed the last slash as you suggested but reflecting the same issues.My file is attached for your reference.

    C:\Users\USER\Desktop\inventory
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-11-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    7

    Re: Save excel file in pdf in specific location.

    I am using 2007.My file is attached for your reference.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Save excel file in pdf in specific location.

    i gave my own folder name, it is working well try 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. Save excel file in pdf in specific location
    By MANOJKUMARJHA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2018, 03:32 AM
  2. [SOLVED] Add in code to save in specific file location.
    By Hyperion1571 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2018, 11:48 AM
  3. [SOLVED] Save file to a specific folder location
    By leebird in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2017, 07:32 PM
  4. Macro to take embedded pdf docs in an Excel file and save to a specific location
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2016, 04:46 PM
  5. Replies: 3
    Last Post: 04-04-2016, 03:50 AM
  6. [SOLVED] Macro to manually choose PDF file and save it to a specific location with specific name
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2014, 07:47 AM
  7. Replies: 0
    Last Post: 07-11-2013, 02:08 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