+ Reply to Thread
Results 1 to 9 of 9

run time error '5" invalid procedure call or argument

  1. #1
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    run time error '5" invalid procedure call or argument

    hi can u guys help me i try to print PDF from wb in the folder my code giving this error thaks in advance .
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: run time error '5" invalid procedure call or argument

    jay, in future please be specific about WHERE the error is happening? I was eventually able to duplicate the problem... but you are setting the variable Fname equal to a function? what is the purpose of "Fname = Dir" ?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: run time error '5" invalid procedure call or argument

    hi arkadi thanks for response.
    im do not to too much about programing so pl bare with me
    i do not know i found this code and altering for printing pdf file so i do not know but in original code that was there the original code was as follows
    Please Login or Register  to view this content.
    so i just add my old code in loop and i try and error to fix the prob but i stuck
    btw code find the 1st file and print in pdf but it do not pass at "Fname = dir" so
    can u pl help me thanks again

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: run time error '5" invalid procedure call or argument

    Where did this code come from? It is missing something.... xFname$ = Dir(something) but I don't know what the "something" should be yet...

    Try this (notice I added the brackets in red):

    Please Login or Register  to view this content.
    Last edited by Arkadi; 05-12-2015 at 11:30 AM.

  5. #5
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: run time error '5" invalid procedure call or argument

    i try this one
    Please Login or Register  to view this content.
    now just open 1 st file again and again code stuck at following

    Please Login or Register  to view this content.
    Last edited by jay11; 05-12-2015 at 11:44 AM.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: run time error '5" invalid procedure call or argument

    Yes your adaptation of the original code was pretty good, but does not fully work. Truth is, this is a bit more complicated. I will see what I can do and post the results.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: run time error '5" invalid procedure call or argument

    Try this version:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: run time error '5" invalid procedure call or argument

    thanks a lot's it work great

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: run time error '5" invalid procedure call or argument

    Great jay
    Can you mark the thread as solved? Thanks!

+ 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. Help! Run-Time Error '5': Invalid procedure call or argument
    By capwork in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2015, 08:10 PM
  2. Run-time Error 5 "Invalid Procedure Call or Argument"
    By dinakar.yadav in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 09:22 AM
  3. 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
  4. Replies: 2
    Last Post: 02-24-2006, 05:30 PM
  5. Run Time Error 5 - Invalid Procedure Call or Argument Q
    By John in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2005, 05:05 PM

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