+ Reply to Thread
Results 1 to 4 of 4

Error when opening excel files with auto-updating list boxes

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Error when opening excel files with auto-updating list boxes

    I am learning VBA, and am currently working on making a unit converter.

    I have 2 sets of three list boxes, and for each set the selection in the first list box determined what populates the other two. Everything is working perfectly, but when I open the excel file I get two run time errors, saying "Object Required".

    Here's what the code looks like for one set:

    Please Login or Register  to view this content.
    The red is where I get the error. It happens for each set of three, so I get an error in ListBox2, and ListBox5 (the sets being Boxes 1, 2, 3 and Boxes 4, 5, 6). I don't get errors for ListBox3 of ListBox6, even though the command in the same.

    If I hit "end" for each of the errors, I can use the workbook without issue. Unit Converter.xlsm

    What am I doing wrong?

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Error when opening excel files with auto-updating list boxes

    Hi toxicon, for both your click subs, add the On Error Resume Next and On Error GoTo 0 like
    Please Login or Register  to view this content.
    That should do the trick!
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    07-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Error when opening excel files with auto-updating list boxes

    Works like a charm! Thanks!

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Error when opening excel files with auto-updating list boxes

    Thanks for the reps toxikon, appreciate that.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this 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. Replies: 1
    Last Post: 05-25-2013, 06:18 PM
  2. VBA - updating files without opening them
    By Laurene Desire in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2013, 02:58 AM
  3. Replies: 0
    Last Post: 10-07-2010, 02:35 AM
  4. Error opening files from a list in a spreadsheet
    By Anolan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2005, 10:25 AM
  5. [SOLVED] error opening excel 2000 files
    By jch in forum Excel General
    Replies: 0
    Last Post: 03-22-2005, 01:06 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