+ Reply to Thread
Results 1 to 10 of 10

Run Time Error: Item with specified name not found

  1. #1
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Angry Run Time Error: Item with specified name not found

    So I'm using shapes in my database to pull information from the sheet into another. However when I click on a second shape over the information I want to pull I get the run time error stating that the specified name could not be found; when I click on a third shape it functions correctly until I click on a fourth shape and so on. 1st 3rd 5th etc good; 2nd 4th 6th etc run time error.

    Please Login or Register  to view this content.
    Any ideas as to what's going on?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run Time Error: Item with specified name not found

    I'm assuming the error occurs on this line, but if it's a different line you need to tell us.
    Please Login or Register  to view this content.
    Are all the shapes set to "assign macro" to this sub? Have you checked the value of Application.Caller at the point where you get the error?

    I'm not sure what's causing that error but you should dimension rn as Long instead of String.

    Can you attach your file? The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Run Time Error: Item with specified name not found

    Yes all the shapes are assigned this macro.
    The line in question does pull the correct row number even when the error occurs. Additionally, when I remove the protection and un-protect
    sequence from the script there is no error. The yellow lines in the file have the protection sequence while the clear lines do not.

    I need the unprotect and re-protect sequences since non admin users will be accessing this database and I don't
    want them to be able to make changes or access the code

  4. #4
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Run Time Error: Item with specified name not found

    Here is the file
    Attached Files Attached Files

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run Time Error: Item with specified name not found

    Why do you run the unprotect/protect in a loop? BTW for this type of loop, the textbook method is a For loop.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run Time Error: Item with specified name not found

    This does not exist

    Admin_Unprotect_Workbook

    so I commented that line out to get your code to run.

    The problem is that something in your code is activating Order_Builder before it gets to the line of code causing the error, so ActiveSheet is no longer Database. If you want the sheet reference to be Database, then use that instead of ActiveSheet. I counsel against using ActiveSheet in most situations and this is a classic example of why.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Run Time Error: Item with specified name not found

    Thank you very much 6StringJazzer! That was a huge help!!!

  8. #8
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Run Time Error: Item with specified name not found

    also I ran the unprotect/protect in a loop because excel kept skipping it in execution. Running it twice in a loop was the only way I could get excel to not skip it

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run Time Error: Item with specified name not found

    The bit about the loop doesn't make any sense to me. I would have dug into it but I'll bet Admin_Unprotect_Workbook has something to do with it and you did not include that in the file you attached.

  10. #10
    Registered User
    Join Date
    05-25-2018
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    9
    yes thats true. Its a script that runs to password protect and unprotect the sheets and workbook. Without the loop excel kept skipping it an either leaving the sheet unprotected or otherwise

+ 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] Error: Item Text not found in Shapes Collection
    By ell_ in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-15-2018, 11:11 PM
  2. runtime error '-2147024809 (80070057)' The item with the specified name wasn't found
    By jigarrathod in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2017, 09:18 PM
  3. Replies: 0
    Last Post: 12-08-2014, 06:46 AM
  4. Run-time error '-2147024809 (80070057)' Item with specified name wasn't found
    By tom_6030 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-08-2014, 10:24 PM
  5. [SOLVED] run time error '3265'; item cannot be found in the collection corresponding to the regues
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-08-2014, 03:29 AM
  6. Replies: 2
    Last Post: 05-13-2014, 07:07 AM
  7. [SOLVED] Run Time Error 3265 - Item not found in this collection
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 07:19 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