Missing libraries

mattpfc

Active Member
Joined
Nov 21, 2002
Messages
299
Hi all,

I have just moved a database I developed from in access 2003 to a machine running access 2000. i have come acroos some problems with missing libraries and was woundering if anybody could direct me to a good source where I could obtain these libraries and read instructions on how to register them properly.

I have tried getting some of the files off of the machine with the 2003 version of office but have come across some problem registering the correct files, and am worried that I may damage the office 2000 installation by adding these libraries?

The missing libraries I have are as follows:

MISSING: Microsoft Word 11.0 object library
MISSING:Microsoft Excell 11.0 object library
MISSING: Microsoft Word 10.0 object library

Many thanks in advance for all suggestions and help given.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi mattpfc

You will find the library in the folder at the path :

C:\Program Files\Microsoft Office\Office\

On the 2003 machine it's a hidden file called mso11.dll.

To register a file on a machine do like so:

Add the new file to the 2000 machines C:\Program Files\Microsoft Office\Office\*.dll location and Type

Code:
Regsvr32 C:\Program Files\Microsoft Office\Office\mso11.dll

into the Start --> Run space, and the file will be registered in the Windows Registry.

My Access 2000 version has a utility in the Tools --> Database utilities --> convert Database menu that will convert a database to a version prior to Access 2000. Surely 2003 has a utility like that too??

anvil19
:eek:
 
Upvote 0
Hi anvil19,

thanks for the advice I managed to track down most of the required libraries and register them, however a couple of the missing ones gave problems namely the microsoft word and microsoft office object libraries.

On the 2003 machine the path for these libraries is displayed so I located the file and copied it across to 2000 machine, however these files are .OLB format and when registering on the 2000 machine a message come up stating that the registered fill was of not of the .dll or .ock format.

Are there .DLL files that can be registeres for the WORD 11 and OUTLOOK 11 object libraries?
 
Upvote 0
Maybe an easier work-around would be to deSelect the missing libraries from your project and in their places to select the highest comparable libraries? For example, instead of Word 11.0, use Word 10.0, 9.0, or whatever is on the machine. For future reference, whenever I need to use Office Automation as it sounds like you're doing, I always use Late Binding rather than Early Binding, that way a reference need not be set to the Object Library.
 
Upvote 0
Hi Dugantrain,

thanks for your input, I have read around late binding and am yet to find a comprehensive article that supports this approach.

However with all the probelms that are arising with the migration of this access project I may well consider this method.

Do you know of any articles I could read or examples of code I could look at to see how this approach is implemented?

Thanks in advance
 
Upvote 0
Early Binding example (requires a Reference):
Code:
Dim xlApp as Excel.Application
Dim xlWB as Excel.Workbook
Set xlApp=New Excel.Application
Set xlWB=xlApp.Workbooks.Add
Late Binding example (no reference required):
Code:
Dim xlApp as Object
Set xlApp=CreateObject(Excel.Application)
Set xlWB=xlApp.Workbooks.Add
Late Binding is theoretically slower than Early Binding, but with Access apps, you're really not going to notice a difference (if you were developing a web application with 100's of concurrent users, you'd notice a HUGE difference). Also, with Late Binding, you don't get the IntelliSense auto-fill-in that you're used to, so you kind of have to know what you're doing before you start writing. Often, I'll write a procedure with Early Binding so that I can figure out what I need to do and then rewrite it with Late Binding.
 
Upvote 0
I am a little confused, I think I may be using late binding already but still come across problems when using access 2000 suite


Here is my code:-


Code:
Private Sub cmd_email_options_Click()
Dim oMSOutlook As Object
Dim oEmail As Object
Dim EmailAddress As String
Dim EmailSubject As String
Dim EmailBody As String
Dim get_email_addresses As New ADODB.recordset
Dim word_document As New Word.Application
Dim email_string As String
Dim varitm As Variant


' preliminary check to ensure user selects an option to build the correct mailing list
If Me.cbx_all_stallholders.Value = False And Me.cbx_selected_stallholders.Value = False Then
        MsgBox "You must select the an option in relation to which stallholders you wish to email!", vbInformation + vbOKOnly, "Error! Select appropriate email options"
End If

        ' if all stallholders option selected run this section of code
        If Me.cbx_all_stallholders.Value = True Then
        
            'recordset population, returns all email addresses stored within 'Stallholder' table
            get_email_addresses.Open "SELECT stallholder_email_address FROM stallholder", CurrentProject.Connection, adOpenDynamic, adLockPessimistic
            
            'loop which is populated with each item in the 'get_email_addresses' recordset
            Do While get_email_addresses.EOF = False
                EmailAddress = EmailAddress & get_email_addresses(0) & ";"
                get_email_addresses.MoveNext
            Loop
            
            get_email_addresses.Close
        
        ' if selected stallholders option selected run this section of code
        Else
                ' loops through each of the selected items in the list box and adds the stallholder email address to string
                For Each varitm In Me.lst_email_stallholder_selection.ItemsSelected
                        EmailAddress = EmailAddress & Me.lst_email_stallholder_selection.Column(3, varitm) & ";"
                Next varitm
              
        End If

' Sets the application as Outlook and creates default email message
Set oMSOutlook = CreateObject("Outlook.Application")
Set oEmail = oMSOutlook.CreateItem(olMailItem)

' sets email parameters


EmailSubject = Me.txt_email_subject_line


If Me.cbx_email_blank.Value = True Then
        EmailBody = ""
End If

    If Me.cbx_Email_from_file.Value = True Then
            Me.txt_email_body_text_path.SetFocus
            If Me.txt_email_body_text_path.Text = "" Then
                    MsgBox "You must select a file to open as the body of the email!", vbExclamation + vbOKOnly, "Email Body - File Selection"
                Exit Sub
            Else
                    word_document.Documents.Open Me.CommonDialog_Email_Body.FileName, False, True
                    email_string = word_document.Documents(1).Content
                    EmailBody = email_string
            End If
    End If

        If Me.cbx_email_Manual.Value = True Then
              Me.txt_email_body.SetFocus
              EmailBody = Me.txt_email_body.Text
        End If

'quit the word document application
word_document.Quit


'create the mail message
With oEmail
    .Subject = EmailSubject
    .Body = EmailBody
    .To = EmailAddress
    .cc = "Chris.Chaddock@btinternet.com;Martin.Fox@btinternet.com"
    .Display
If Me.txt_email_attachment1.Value <> "" Then
        .Attachments.Add Me.txt_email_attachment1.Value
End If
    
    If Me.txt_email_attachment2.Value <> "" Then
            .Attachments.Add Me.txt_email_attachment2.Value
    End If
        
        If Me.txt_email_attachment3.Value <> "" Then
             .Attachments.Add Me.txt_email_attachment3.Value
        End If
End With


'clears the objects
Set oMSOutlook = Nothing
Set oEmail = Nothing
Set word_document = Nothing

End Sub
 
Upvote 0
I haven't read all of your code, but just at a glance,
Dim word_document As New Word.Application
is Early Binding. It looks like you have both Early and Late Bound objects in this example.
 
Upvote 0
Hi,

I hope Dugantrain doesn't mind me chipping in here. I wrote a little tutorial on late binding for my website. My site is currently trashed so here is the gist of what it said. I hope you find it useful :)

<hr>




You are probably aware that VBA allows you to "bind" to another application and use that application's methods and properties just as though you were programming directly in that application. This is commonly used to automate one application from within another e.g. controlling Microsoft Outlook from within Microsoft Excel. Here is a very simple example demonstrating this technique. You need to have Microsoft Outlook installed for this to work.</p>

  1. Open Excel and activate the Visual Basic Editor (Alt F11).
  2. Click Tools, References on the VBE toolbar and look for Microsoft Outlook n.x Object Library where n.x will depend on the version of Outlook available on your machine.
  3. Insert a standard module and paste the following code:

    Code:
    Sub EarlyBindingExample()
        
        Dim olApp As Outlook.Application
        Dim olContact As Outlook.ContactItem
    
        Set olApp = New Outlook.Application
    
        Set olContact = olApp.CreateItem(olContactItem)
    
        With olContact
            .FirstName = "Daniel"
            .LastName = "Klann"
            .Email1Address = "dan@danielklann.com"
            .Save
        End With
    
    
    End Sub
  4. Run the macro. If you go into Outlook you will see that you have a new contact, me!



Now this code should work perfectly time and time again. Problems may occur however, when you send your workbook off to another colleague, client, friend or whoever and they have a different version of Outlook than you. You may get compile errors - 'Sub or Function not Defined' and the references will be marked MISSING in the References dialog.</p>



Specifically, the problem occurs if the recipient has an older version of the application than the one the project was created in. For example, I develop a project with the above code and I'm using Outlook 2002. I then send the project onto a colleague who uses Outlook 2003. VBA will correctly update the reference to the new library and the code will function without problem. However, if the colleague is using Outlook 2000 for example, then they will develop symptoms similar to those described above and your code will fail. The goal is to create code that will run as expected regardless of which versions of software are installed.</p>



The most reliable way to get round this problem is to ditch early binding (as demonstrated above) and use late-binding. Late binding is where VBA will create objects "on-the-fly" without knowing in advance what type of object it's going to be creating (including which version). There are distinct disadvantages to late-binding: </p>

<ul>
[*]You will lose the Intellisense drop-down box that lists properties and methods for whatever class you're working with. This could significantly impact development time.
[*]Compile-time errors won't be picked up e.g. missing required arguments.
[*]Your final code will run more slowly than if you'd used early-binding. However, the impact will probably not be too severe.
[/list]



The first two of these can be eliminated by using early-binding whilst developing and then converting to late-binding once you're satisfied that your application functions as expected.</p>



The steps involved: </p>

  1. Declare any specific classes as the generic Object variable type.
  2. Replace any usage of the New keyword with CreateObject.
  3. Convert symbolic constants to their literal equivalents, or define those constants yourself.
  4. Remove any references from your project relating to the external libraries.
  5. Compile and test your project.



For this example, I'll use the code from above.</p>

  1. Once you remove the reference to Outlook, VBA will not know what Outlook is and it will not be able to resolve Outlook.Application and Outlook.ContactItem. They need to be declared as Object.

    Code:
        Dim oOLApp As Object
        Dim oOLContact As Object



    Note : I prefer to prefix any variables declared as object with a lower case 'o'. This is not required, it's just my preference.</p>



  2. The New keyword is used to instantiate an instance of a class i.e. create an object of the specified type. Instead of using New, we need to use CreateObject:

    Set oOLApp = CreateObject("Outlook.Application")


  3. As the Outlook library is not available at compile-time obviously any constants defined in that library will also not be available. In the example the constant olContactItem will be undefined. We need to find out what its value is by either looking for its value in the object browser or by opening the immediate window and typing ?olcontactitem. Either way, its value is 2. My personal preference is to define the constants in my code, rather than using their numeric equivalent. This allows you to maintain readability and will help you understand what the code is doing when you go back to it in a year's time. Here is what the revised code would look like:

    Code:
    Private Const olContactItem As Long = 2
    
    Sub AutomationExample()
        
        Dim oOLApp As Object
        Dim oOLContact As Object
    
        Set oOLApp = CreateObject("Outlook.Application")
    
        Set oOLContact = oOLApp.CreateItem(olContactItem)
    
        With oOLContact
            .FirstName = "Daniel"
            .LastName = "Klann"
            .Email1Address = "dan@danielklann.com"
            .Save
        End With
    
    
    End Sub





In essense, that is all you need to do. Obviously for larger projects this may be a time consuming process but if your target users will be using different versions of applications then it is the safest way to develop your projects.</p>
 
Upvote 0
Excellent! A great article, thanks loads DK!

I am now going to alter my code to use late binding, in an attempt to automatically create an email from user input on a MS access form.

Thanks again to both Dugantrain and DK for all help and advice given.
 
Upvote 0

Forum statistics

Threads
1,221,680
Messages
6,161,251
Members
451,692
Latest member
jmaskin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top