+ Reply to Thread
Results 1 to 8 of 8

Error On VBA code on same procedure

  1. #1
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Error On VBA code on same procedure

    Dear experts

    I have set of macro export data to closed wb like A,B,C.xslb...etc thorugh parameter of file names listed in columns.

    I have 3 sheets Data,Partner,Agent have similar code to export data to closed wbs. but code getting error on sheet! partner

    i am getting error as "Run-time error '1004' @module2

    The extract range has missing or illegal filed name


    and i want add If File Does Not Exist Go To Next File in 3 code like A,B,C listed in names but A,C only there but the code stops there

    find the wb input(MasterAccount) and ouput(A) attachments:
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Error On VBA code on same procedure

    You could use (just before the line which throws the error):
    Please Login or Register  to view this content.
    which makes the code just carry on to the next line
    and then insert immediately below the line in the code that throws an error (ie after trying to find the file):
    Please Login or Register  to view this content.
    (which cancels it again)

    Be very careful when you use this - it is not always appropriate!

    Do you understand why you getting the error?
    - does the file not exist?
    - are there illegal characters in the attempted file name?
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  3. #3
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Error On VBA code on same procedure

    Ya sir File is already exist inpath .it works In sheet Data & Agent why not partner sheet pls check in your system .

  4. #4
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Error On VBA code on same procedure

    Is it macro "Partner" in workbook Master_Account that is throwing the error?
    Which line in the macro is giving you the error?

    thanks

  5. #5
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Error On VBA code on same procedure

    Please find the error line
    Attached Images Attached Images
    Last edited by johnmacpro; 04-11-2016 at 01:43 AM. Reason: reason

  6. #6
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Error On VBA code on same procedure

    For some reason there is a problem in Excel sometimes with xlFilterCopy - it just refuses to work. I tried setting ranges using variables but that did not work either.
    Your code is correct but it does not run. So this is a workaround.

    Method:
    - replace xlFilterCopy with xlFilterInPlace
    - replace columnV with specified range (code runs faster)
    - after filtering copy columnV values and paste to columnAA
    - remove the filter

    So to make it work, try the following
    REPLACE
    Please Login or Register  to view this content.
    WITH
    Please Login or Register  to view this content.
    NOTE - the code would work using .columns("V:V") but runs much slower
    Last edited by Kevin#; 04-11-2016 at 04:40 AM.

  7. #7
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Error On VBA code on same procedure

    Thanksalot sir it works fine!!! Amazingly

  8. #8
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Error On VBA code on same procedure

    If your problem is solved, please mark thread as solved (go to ThreadTools at top of thread)

+ 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] Simply code to avoid procedure too large error message
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-03-2015, 11:02 AM
  2. Procedure skips portion of code when called from another procedure
    By abkar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-26-2014, 05:14 PM
  3. Run time error '5': Invalid procedure call or argument getting error
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2014, 04:48 AM
  4. Need help simplifying code. Shape Color. Complie error: Procedure too large
    By xe-dingo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2014, 07:16 AM
  5. Error Message (Compile Error, Procedure too Large)
    By dreicer_Jarr in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 10-29-2010, 03:52 AM
  6. Macro code too long: "Procedure too large" Error
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2010, 03:16 PM
  7. Replies: 1
    Last Post: 02-08-2006, 06:25 AM

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