+ Reply to Thread
Results 1 to 8 of 8

Error (?) 400 setting reference

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Error (?) 400 setting reference

    I'm trying to set a reference to my personal file (VBE TOOLS>REFERENCES). I keep getting a message box with a title "Microsoft Visual Basic", an "X" inside a red circle (critical) and "400" as the message, with "OK" and "Help" buttons. I click "Help" and get no help, just the "getting started" screen of help. I click "OK" and the reference is not set.

    I have had no problem setting the reference before.

    I just discovered that macros were turned off in this file. I closed the file and reopened it with macros enabled and the Error (?) went away.

    I have had this same message box before under different circumstances and was never able to discover what it meant or if it was causing any problems.

    Can anyone enlighten me as to what "400" means?
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Error (?) 400 setting reference

    Hello foxguy,

    Error 400 is a very generic code "Application defined or Object defined error." It would help to see your code and know if this error happens in Excel 2003 or 2007.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Error (?) 400 setting reference

    Hi Leith;

    There is no code. I am manually trying to set the reference to my personal file. It doesn't say "Error 400", it just says "400" absolutely nothing else. That's why I wonder if it is an error code.

    It's currently happening in Excel 2007, but it has happened in the past in 2002.

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Error (?) 400 setting reference

    I think I just realized another factor.

    It used to happen quite frequently when I was opening Excel, but since I didn't have the option to "Debug" I couldn't figure out what was happening. When I put a "Stop" in a Workbook_Open(), it never gave me the message.

    Since this time I am positive about what action is causing the msgbox to appear, it gives me a hint.

    In the past I had 3 files in my Startup folder. 2 of the files referenced the 3rd. If Excel opened one of the 2 files before the 3rd was opened, the "Run" command would not work.

    Now because I know that it has something to do with referencing another file, I think that might have been triggering it in the past when I opened Excel and a file that referenced another file was being opened before the referenced file was open.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Error (?) 400 setting reference

    Hello foxguy,

    The error that I typically see with setting References is
    Run-time error '32813':
    Name conflicts with existing module, project, or object library

    This indicates the reference is already loaded. Error 400 would indicate some other problem, but exactly what is difficult to say, but it isn't normal to see this error.

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Error (?) 400 setting reference

    At least you were getting a message that had the word "Error" in it. My message doesn't have the word "Error", just "400" - no indication that it's an error. For a while I thought that my code was putting up the msgbox, but I could not find anywhere that I could find the # 400 to put into the prompt.

  7. #7
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Error (?) 400 setting reference

    Leith;

    This indicates the reference is already loaded
    I get the impression that you are trying to set the reference in your code.
    If that is true, how are you doing it?

    If not in code, then how can you even attempt to reload a reference. All I have is a checkbox to load or unload the reference.

    I almost get the idea that we are talking about 2 different things.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Error (?) 400 setting reference

    Hello foxguy,

    I was out with my family tonight and just got back a little while ago (typical California schedule). Anyway you can set a reference using VBA rather than doing it manually. Here is a macro to load a reference to the Microsoft Visual Basic for Extensibility for Excel 2003.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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