+ Reply to Thread
Results 1 to 8 of 8

Run time error 1004 on userform initialize

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Run time error 1004 on userform initialize

    I was in the middle ** working on my workbook and for some reason I'm now getting Error 1004 on my user Login user forms that load when the workbook opens. I can't figure out why, so I went back to my latest backup from this morning and exported the user forms from that workbook (which work fine) and imported them into my current workbook, and also copied over all the code in ThisWorkbook, but it still gives me the same error (even though they work fine in the backup workbook). I have done so much since the backup tho morning, that I dont know what I have done to mess it up.
    The userforms are called Users and Users2.
    I also noticed that the Change_Event code for the sheets ReturnData and EquipmentData stopped working. In the case ** ReturnData its supposed to add todays date into the G column when data is entered into G. I dont know if this is linked to the issue.
    Thank you for you time,
    James
    Attached Files Attached Files
    Last edited by Nitefox; 03-08-2014 at 11:38 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Run time error 1004 on userform initialize

    Try with other userforms names
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Run time error 1004 on userform initialize

    Im not sure what you mean, these are the only two I have. I made them from scratch for my specific needs. They used to work just fine. I seems like the problem isn't with the forms themselves, because when I take the exact same forms (same code and everything) from my backup on which they are working just fine, and then import them into this workbook then they still dont work. Along with my sheet change event code not working to there must be something else going on.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run time error 1004 on userform initialize

    This is actually where the error is.
    Please Login or Register  to view this content.
    I think you need to check out your named range 'Usernames'.

    PS Why does that range start at A3?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Run time error 1004 on userform initialize

    I dont want the username Admin to show up in the list, so it starts with A3.

  6. #6
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Run time error 1004 on userform initialize

    I see what happened now, there are currently no usernames below Admin. How can I get around this? When the workbook started out the only user will be Admin on A2, therefore nothing should show up in the Usernames combo box on Users.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run time error 1004 on userform initialize

    The formula used for the named range 'Usernames' evaluates to #REF!.

  8. #8
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Run time error 1004 on userform initialize

    I manually typed some usernames back into the Users sheet on A3 and A4 and now it works great, thank you.
    How can I prevent this from happening in the future, as I mentioned when the wordbook starts out fresh the only user will be Admin, so the Range will come up blank, until the user creates one.

+ 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. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  2. Fix Userform IF Statement - Run Time Error "1004"
    By sawan202 in forum Excel General
    Replies: 2
    Last Post: 03-07-2012, 06:32 AM
  3. Run time error 1004-created a userform
    By scrupo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2010, 04:11 AM
  4. Run-time error 1004 when trying to load UserForm
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-22-2008, 04:28 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