+ Reply to Thread
Results 1 to 7 of 7

Runtime error 5 - Invalid Procedure or Call - Print Pdf

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Runtime error 5 - Invalid Procedure or Call - Print Pdf

    Hi,

    I have the following macro that runs when a button is clicked. It basically creates a PDF of the document, saves it and emails it. However despite the fact I had it working, it appears to have chucked a wobbly, giving me the error:

    Runtime error 5 - Invalid Procedure or Call

    Here's the code, with the bold text at the point it is failing. Anyone have any suggestions as to what I should check?


    Please Login or Register  to view this content.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    Just as a note!

    Avoid to use the word "Print" at the end of your title because the thread takes a printable view and no one is able to reply(i reversed the last 2 words in your title!).

    Good luck with your thread!
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    hi Barking_Mad,

    As a quess for possible reason:
    1. Your Excel does not support that. Check it by manually exporting range to PDF. If I'm not mistaken this method (ExportAsFixedFormat) has appeared in Excel 2007 starting from SP2. Check you version.
    2. PDF add-in might not be installed (reason stated by MSDN): http://msdn.microsoft.com/en-us/libr...ffice.12).aspx

    On Excel 2010 there is no problem with the code posted.

  4. #4
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    Fotis! Sorry!

    Given that it was working last week - and hasn't been changed maybe a system update to the network has caused it to stop working?

    Or 1 or 2 is the problem, is there an alternative way of doing it?

  5. #5
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    Actually, it seems that the problem is that it is a shared workbook.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    it (error) has definitely nothing to do with the code itself ...

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Runtime error 5 - Invalid Procedure or Call - Print Pdf

    ......... wrong window

+ 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. Invalid procedure call or argument (Error 5)
    By vop2311 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2014, 07:27 PM
  2. Run-time error 5, Invalid procedure call or argument
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2014, 08:29 AM
  3. error 'Invalid Procedure Call or Arguement'
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2009, 07:28 AM
  4. Runtime Error 5: Invalid procedure call or argument
    By Arasi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-07-2009, 11:49 AM
  5. Invalid procedure call or argument error
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2006, 06:45 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