Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 25

Thread: Solved: Object Library Not Registered

  1. #1
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location

    Solved: Object Library Not Registered

    Recently, I had a hard drive disaster. I thought that all files had been
    restored, I guess not.

    The system is multiboot, with Win 2000 on the C drive and Office 97
    installed under that OS.

    Today I tried looking at Tools | References in the Word VBIDE.
    I was not given the list of references, instead I got a message box stating
    "Object library not registered".

    Note that macros seem to run, I just cannot use Tools | References.

    This problem does not occur in either Excel or Powerpoint.

    The help for the message is something like that below the dashed line below

    What's the fix?
    How do I reregister VBA for Word?
    A similar problem seems to be addressed in KB article 315576.

    I tried uninstalling, the re-installing Office 97, but that did not really
    work.
    Indeed, I had Office 97 SR-2 installed, so when I uninstalled Office 97,
    then used an Office 97 SR1 to re-install, I was surprised to find that the
    Help still said SR2.:

    Is there a fix?

    Or will I have to use eraser97 to wipe out Office 97, then re-install?
    --------------------------------------------------------------------------
    Object library not registered


    The Visual Basic for Applications object library is no longer a standalone
    file; it is integrated into the dynamic-link library (DLL).

    In earlier versions, when you started an application that uses Visual Basic
    for Applications, certain object libraries were loaded. This error has the
    following cause and solution:

    a.. An attempt was made to load a previous version of the Visual Basic for
    Applications object library (vaxxx.olb) or host-application object
    libraries. However, the correct language version of these object libraries
    could not be found in the system registry.
    Reregister your application. On the Macintosh, delete the vba.ini file
    from the Macintosh Preferences folder, and restart your application.

    For additional information, select the item in question and press F1 (in
    Windows) or HELP (on the Macintosh).

  2. #2
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Here's EXACTLY what I would do, Howard:
    1. Close Word if it's open.
    2. Start-->Run and type regedit and hit Enter
    3. Browse to the following folder:
      hkey_current_user\software\microsoft\office\8.0\word
    4. Right-click and hit RENAME and call it OldWord
    5. Re-launch Word.
    This forces Word to re-register itself with Windows. For "listeners", the 8.0 means Office 97. 2000 is 9.0, XP is 10.0 and 2003 is 11.0. This fix works for virtually all the apps (changing the folder of course) when you THINK you need to reinstall the program, or when reinstalling doesn't help.

    Good luck, Howard!
    PS: Renaming the folder alleviates the need to backup the Windows registry. Suppose the fix doesn't work for you, or you're worse off than when you started (for some strange reason). Then, you just go back in there, delete the newly created Word folder, and rename OldWord back to Word, and you're back where you were when you started.
    ~Anne Troy

  3. #3
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Dreamboat
    Here's EXACTLY what I would do, Howard:

    1. Close Word if it's open.
    2. Start-->Run and type regedit and hit Enter
    3. Browse to the following folder:

      hkey_current_user\software\microsoft\office\8.0\word
    4. Right-click and hit RENAME and call it OldWord
    5. Re-launch Word.
    This forces Word to re-register itself with Windows. For "listeners", the 8.0 means Office 97. 2000 is 9.0, XP is 10.0 and 2003 is 11.0. This fix works for virtually all the apps (changing the folder of course) when you THINK you need to reinstall the program, or when reinstalling doesn't help.

    Good luck, Howard!
    PS: Renaming the folder alleviates the need to backup the Windows registry. Suppose the fix doesn't work for you, or you're worse off than when you started (for some strange reason). Then, you just go back in there, delete the newly created Word folder, and rename OldWord back to Word, and you're back where you were when you started.
    Thanx fer the suggestion.

    Has no effect on the problem.


    Hmmm. perhaps I'll run WinDoctor to see whether anything is detected.

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Well...you can completely remove Office manually instead of using Eraser, which never was very efficient anyway.

    Here's an extensive writeup I did quite some time ago.
    http://forums.techguy.org/t192959
    ~Anne Troy

  5. #5
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Dreamboat
    Well...you can completely remove Office manually instead of using Eraser, which never was very efficient anyway.

    Here's an extensive writeup I did quite some time ago.
    http://forums.techguy.org/t192959
    First, I will uninstall Office using Add/Remove programs.
    This should have the advantage of removing the uninstall entry, which is not difficult to remove with a registry edit, but is cleaner this way.

    Then I will move/rename the Office files and the Office registry key.

    But, before doing the above, I'll take a look at the latest eraser97 stuff, maybe there's a more recent version?

  6. #6
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Quote Originally Posted by Howard Kaikow
    maybe there's a more recent version?
    Nope...
    ~Anne Troy

  7. #7
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Dreamboat
    Nope...
    I just downloaded the latest eraseer97.exe.

    It's not the same size as the one I downloaded many moons ago.

    The difference could be die to different compaction, but I dunno.

  8. #8
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Howard, re the other thread on making references via Automation. I believe these are related. Whatever you have....I now have as well. i used to have no problems, but now - after I opened your file (re:the Automation post), I no longer has any control over references and type libraries.

    Whatever you have, it is transmissable...and is gonna be a great big pain in the butt to try and fix this. This is a huge problem for me, and has really ticked me. If you find a solution, PLEASE post it!

  9. #9
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    And YO!, people!!! Do NOT download Howard's file!

    I have tried re-registering Office apps. I have tried reloading and manually re-registering the DLLs directly. NOTHING. I can no longer set references...at all.

    Howard....oh never mind.

  10. #10
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by fumei
    Howard, re the other thread on making references via Automation. I believe these are related. Whatever you have....I now have as well. i used to have no problems, but now - after I opened your file (re:the Automation post), I no longer has any control over references and type libraries.

    Whatever you have, it is transmissable...and is gonna be a great big pain in the butt to try and fix this. This is a huge problem for me, and has really ticked me. If you find a solution, PLEASE post it!
    If all you did was use the source I posted, that did not tranmit anything.

    My problem with Office 97 is due to replacing a disk drive and the files not being properly restored. It's got nothing to do with the set reference issue,

  11. #11
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Howard Kaikow
    First, I will uninstall Office using Add/Remove programs.
    This should have the advantage of removing the uninstall entry, which is not difficult to remove with a registry edit, but is cleaner this way.

    Then I will move/rename the Office files and the Office registry key.

    But, before doing the above, I'll take a look at the latest eraser97 stuff, maybe there's a more recent version?
    The task is complicated because I also have Expedia 98, Outlook 98 and
    Publisher 98 installed.
    I guess that I need to uninstall those before using eraser97.

    Then re-install Outlook 98 and Publisher 98.
    Then Office 97 SR1, then SR2.

  12. #12
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by fumei
    Howard, re the other thread on making references via Automation. I believe these are related. Whatever you have....I now have as well. i used to have no problems, but now - after I opened your file (re:the Automation post), I no longer has any control over references and type libraries.

    Whatever you have, it is transmissable...and is gonna be a great big pain in the butt to try and fix this. This is a huge problem for me, and has really ticked me. If you find a solution, PLEASE post it!
    I just ran the posted stuff using Word 97, Word 2000, Word 2002 and Word 2003.

    All performed as I described in the URL I posted. And there is nothing in the code that can affect anything else.

    I also ran, in Word 97, the sub DemonstrateRefIsNotSaved that I posted here. Sub worked as expected and did add the reference. However, in Word 97, I could not use the Tools | References menu to look at things.

    In my case, the problem is almost certainly due to an improper restore of my drives after replacing a hard drive. This is described in another thread here, where Clearformatting broke until I did a Detect and Repair or re-install in 3 of the 4 Office versions installed.

    The problem wiht Office 97 is more likely due to a subsequent problem with the replacement hard drive (yes, it was replaced twice) and my running WinDoctor. My gut feeling is that I allowed WinDoctor to make changes that I should not have.

    So I will need to uninstalll, maybe use eraser97, to restore Office 97.

  13. #13
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Eureka, I found the problem!

    Permit to pause whilst I let off some steam.

    Hsssssssssssssssssssssssssssssssssssssssss!

    Ah, that felt good.

    After spending severals hours today uninstalling, re-installing, using eraser97 and manually removing things, I was finally able to re-install Office and not have the error occur.

    However, my glee was short lived!

    When I restored my global templates to the Startup directory, the error re-appeared!

    I then added the templates to the Startup directory 1 at a time and found the problem.

    On 4 Oct 2004, I had modified one of the global templates and somehow the reference to the VBA extensibility library 5.3 was "MISSING". Due to changes I made back in Oct, I'm not even sure tgat the reference is any longer necessary, which is likely why I never noticed a problem.

    So, it would appear that I had not used Tools | References in Word 97 since at least 4 October 2004.

    All I had to do was correct the reference in a copy of the global template that was not in the Startup directory, then replace the critter in the Startup directory.

    I used Retrospect to restore the C drive to yesterday's files, then replaced the template.

    Solution was simple.
    Path to finding it very difficult.

    MSFT error message not very useful.

    Why did it not just tell me that there was a specific midssing reference?

  14. #14
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Howard, I have elimated all office products. I took a brand new machine, an unformatted hardrive and installed just the OS (Windows 2000Pro); installed Office. I tried using Automation to adda new reference to a Word document, and a Word tenplate (re: your other thread) and it worked fine.

    I then ran your code, but not your file. You are correct (and my apologies!), it is NOT your file. However, once I ran the code, I could no longer make any references - either manually, or via code.

    I still can not. It is has nothing to do with my drives. I have only the one drive, and ALL it has on it the OS and Office. I still can not add ANY references. I can add a reference manually. I save the file, I look again - Yes, the reference is there. I save the file (but do not close it) - yes, the reference is there. I close the file and open it. NO! the reference is NOT there.

    It does not make any difference if I add the reference using Tools, References (i.e manually), or by code.

    I can not make any new references stick. This is the same in Excel or Word. I can not make references persist after the file is closed.

    I have two global templates. BOTH of which already have Extensibility referenced. There are there and persist. However, even those will not allow any further references to be added. At all. Well I can add them and they remain as long as the file is open. But if I save and close, when I reopen, they are not there any more. I have gone to another machine and added references. On those machines, if the file is saved, closed and reopened, the references are there - they persist. However, if the same file is brought to my machine, the references are NOT there. If I send the file back again to the other machine - the references ARE there. But my machine absolutely refuses to accept any new references.

    This applies to a document, a regular template, or to a global template. It will not allow any new references to be added.

    Thoughts. Apologies again, for stating your file has something wrong. It is clearly NOT your file, but something with the code.

    I went home, and worked on a clean machine. As stated, I had no problem making persistent references UNTIL I ran your code....then BOOM! I can no longer make any persistent references. This was with NO global templates; I was just trying to make new references on a document. No can do. I can NOT add Extensibility, as it no longer allows any new refernces at all.

    Thoughts?

  15. #15
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Darn my fat fingers!
    I just typed in a looooooooooong explanation of why I had my problem and a suggestion as to what you might look for, but my fat fingers caused Firefox to send the posting into the great bit bucket in the sky.

    So, I'll leave out the explanation and just suggest what you try.

    Remove ALL global templates.
    Examine each global template OUTSIDE of the Startup directory using Tools | References to see which reference is MISSING. You appear to have been moving stuff around a lot, that could cause a MISSING reference.

    Correct that reference and the problem should go away.

    I built my code using Word 97, so if you do not modify the template in any way, downloading the .zip, the code will run in Word 97 and up. If there is a MISSING reference in a global template, then that reference is independent of any reference in my template.

    Apparently, Word issues that nasty message if there is a MISSING reference in a global template and does not allow use of Tools | References, even tho code can run if that reference is not needed to run the code. A more friendly message would be to merely state that a particular reference is missing.

  16. #16
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    I don't think you are quite reading things well.

    I have NO global templates - other than normal.dot which I can't do much about. This is a NEW install of Office.

    I have no idea what you are talking about re: moving stuff around. Where are you getting that?

    Let's make this simple.

    1. Fresh machine - new hard drive, unformatted.
    2. Install OS.
    3. Install Office
    4. References can be freely made, saved...whatever
    5. Run your code - NOT your file; I hand wrote it again.
    6. NO references can now be made.
    7. NO globals were made, or exist.

    There can be a gazillion missing references...who cares...I can NOT make any that will persist. Including, BTW VBA Extensibility.

    REPEAT: no references can be made IN ANYTHING (document, global whatever - and to repeat in case you have not read this clearly...there are NO globals).

    I'll ask again. Thoughts? I am willing to listen, but please, be willing to read.

    There are no globals, I am NOT moving stuff around, and I can not make any references persist - either by code, OR by using Tools > References and selecting a references - any reference. They will NOT persist.

  17. #17
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Oh and in case you missed it. You mention:

    "Correct that reference and the problem should go away."

    I can NOT correct any reference as they will not persist.

    Get it?

  18. #18
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by fumei
    Oh and in case you missed it. You mention:

    "Correct that reference and the problem should go away."

    I can NOT correct any reference as they will not persist.

    Get it?
    I was not referring to the reference that is being added.
    I was referring to the reference to the VBA Extensibility 5.3 library.

    If you are working from a clean install of the OS and Office, I'd suggest trying the following:

    0. Create a new template.

    1. Add the following to the template and run the code to see what references are included.

    Private Sub ListReferences()
    	' Requires reference to VBA Extensibility Library 5.3
    	Dim ref As VBIDE.Reference
    	Dim strOutput As String
    	
    	With Application
    		With .ActiveDocument
    			strOutput = ""
    			For Each ref In .VBProject.References
    			    strOutput = strOutput & vbCrLf & ref.Name
    			Next ref
    		End With
    	End With
    	Debug.Print strOutput
    	Set ref = Nothing
    End Sub
    2. Then add and run the following code:

    Private Sub AddReference()
        ' Requires reference to VBA Extensibility Library 5.3
        Dim ref As VBIDE.Reference
        Dim strOutput As String
        
        With Application
            With .ActiveDocument
                strOutput = ""
                For Each ref In .VBProject.References
                    strOutput = strOutput & vbCrLf & ref.Name
                Next ref
                .VBProject.References.AddFromFile FileName:="C:\Windows\system32\scrrun.dll"
                strOutput = "----------------" & vbCrLf
                For Each ref In ActiveDocument.VBProject.References
                    strOutput = strOutput & vbCrLf & ref.Name
                Next ref
            End With
        End With
        Debug.Print strOutput
        Set ref = Nothing
    End Sub
    3. Then create another new template.

    4. Try Tools | References.

    If the code works, but Tools | References does not, the implication is that something is making Word unhappy. In my case, it was a missing reference in a global template. I suspect the same would occur if there were a missing reference in an add-in's template, not necessarily in the Startup directory.

  19. #19
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Howard, please read....again.

    You make the very true point in your first two lines:


    Private Sub AddReference()
    ' Requires reference to VBA Extensibility Library 5.3

    The problem, Howard, and....hmmmmm....I think I have maybe mentioned this.

    I can NOT make any references. I really do not know how many times I can say it...or rather write.

    I can not make any references, including Extensibility. So, as you correctly point out...it requires Extensibility. Great...except...and hows about...oh, maybe the fifth time I have stated this.

    I can NOT make any references that persist. From ANY office app. There are, and I really feel that I am repeating myself, and you are not reading these post, stuck in your own version of reality; but again, there are NO globals, there are NO COM-addins.

    There is nothing in and Startup folder. I have even removed any pointers to a Workgroup folder, orTemplates User folder. It is as blank as can possibly be. I still can not make ANY references - including Extensibility. Which is a major pain, as Extensibility severely limits me. And not being to a make a reference to Scripting Runtime is a HUGE pain, as I can no longer make any use of the FileSystemObject.

    Any thoughts? Your code is lovely (if a bit verbose), but I can not run it, as...are you listening? I can NOT use Extensibility.

    To repeat again, this is a NEW, fresh install of Office, on a New fresh install of Windows 2000. There are no other software installs at all. Nothing.

  20. #20
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    If your installation is "a NEW, fresh install of Office, on a New fresh install of Windows 2000. There are no other software installs at all. Nothing.", then the problem would appear to be a bad install of Office, or a conflict between Office and some component of Win 2000.

    You could try installing Office with, say, just Word and VBA to isolate issues further.

    Does this problem occur with all versions of Office or just a particular version?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •