My database seems to be acting up on me today. It is throwing up errors and highlighting very basic built in functions like Format() and Left(). It's happening when I run my code that I've used for years to filter a continuous form, as well as when I try to use my custom ribbon buttons. I feel like there is a library missing. I've been running Access 2016 on Windows 10 for several months now, and I haven't had this issue before. These are the references I have right now, in this order:
Visual Basic for Applications
Microsoft Access 15.0 Object Library
Microsoft Office 16.0 Access database engine Object Library
Microsoft Office 16.0 Object Library
Microsoft Office.NET Private Object Library
MISSING: Office Communicator W14 Type Library
When I run my code this is what I'm getting -
Can't find project or library
I really don't know much about what is happening behind the scenes with reference libraries, but that is my best guess as to the problem. That last one that says MISSING: is certainly suspicious.
Missing Microsoft Outlook 16.0 Object Library
Using assistance from online resources I have VBA to create an Outlook contact from an Excel spreadsheet. I was told the machines it was to work on were Office 2016, the same as I use. When I took the macros on-site they use Outlook 2016 but Excel 2013; although one machine is all Office 2016. The macro worked on the 'all office 2016' machine but gave an error of 'Missing Microsoft Outlook 16.0 object library.'
I know I should use Late Binding for this, but can't get it to work/am not experienced enough. Having done extensive searches I found the article below (in quotes) and am wondering if I can take the file WITHOUT THE VBA in it to an Outlook 2013 machine, go into VBA Editor, check the Outlook 15.0 Library reference, paste in the VBA, save the document, then run the macro, it will have the correct DLL referred?
This is an extract from the article that prompted this question:-
'One way to deal with this is to create and save the workbook using the earlier version of Excel. When it is opened in the later version of Excel, the reference to the VBA library will be automatically updated. Excel does the updates going to later versions, but it doesn't do them going to earlier versions.
This means, however, that even if the workbook is created in the earlier version of Excel, once it is opened and subsequently saved in the later version of Excel, users of the earlier version will have problems opening it.'
THE VBA CODE
Application.ScreenUpdating = False
If MsgBox('Have you checked if this client has an existing record with us?', vbQuestion + vbYesNo, 'Input Question') < vbYes Then
'Automating Outlook from Excel: This example uses the Application.CreateItem Method to export data from an Excel Worksheet to the default Contacts folder.
'Automate using Early Binding: Add a reference to the Outlook Object Library in Excel (your host application) by clicking Tools-References in VBE, which will enable using Outlook's predefined constants. Once this reference is added, a new instance of Outlook application can be created by using the New keyword.
'Ensure that the worksheet data to be posted to Outlook, starts from row number 2:
'Ensure corresponding columns of data in the Worksheet, as they will be posted in the Outlook Contacts Folder:
'Column A: First Name
'Column B: Last Name
'Column C: Email Address
'Column D: Company Name
'Column E: Mobile Telephone Number
Dim applOutlook As Outlook.Application
Dim nsOutlook As Outlook.Namespace
Dim ciOutlook As Outlook.ContactItem
Dim delFolder As Outlook.folder
Dim delItems As Outlook.Items
Dim lLastRow As Long, i As Long, n As Long, c As Long
'determine last data row in the worksheet:
lLastRow = Sheets('Sheet1').Cells(Rows.Count, 'A').End(xlUp).Row
'Create a new instance of the Outlook application. Set the Application object as follows:
Set applOutlook = New Outlook.Application
'use the GetNameSpace method to instantiate (ie. create an instance) a NameSpace object variable, to access existing Outlook items. Set the NameSpace object as follows:
Set nsOutlook = applOutlook.GetNamespace('MAPI')
'Empty the Deleted Items folder in Outlook so that when you quit the Outlook application you bypass the prompt: Are you sure you want to permanently delete all the items and subfolders in the 'Deleted Items' folder?
'set the default Deleted Items folder:
Set delFolder = nsOutlook.GetDefaultFolder(olFolderDeletedItems)
'set the items collection:
Set delItems = delFolder.Items
'determine number of items in the collection:
c = delItems.Count
'start deleting from the last item:
For n = c To 1 Step -1
'post each row's data on a separate contact item form:
For i = 2 To lLastRow
'Use the Application.CreateItem Method to create a new contact Outlook item in the default Contacts folder. Using this method a new contact item is always created in the default Contacts folder.
'create and display a new contact form for input:
Set ciOutlook = applOutlook.CreateItem(olContactItem)
'display the new contact item form:
'set properties of the new contact item:
..firstName = Sheets('Sheet1').Cells(i, 1)
..LastName = Sheets('Sheet1').Cells(i, 2)
..JobTitle = Sheets('Sheet1').Cells(i, 3)
..Email1Address = Sheets('Sheet1').Cells(i, 4)
..CompanyName = Sheets('Sheet1').Cells(i, 5)
..BusinessTelephoneNumber = Sheets('Sheet1').Cells(i, 7)
..HomeTelephoneNumber = Sheets('Sheet1').Cells(i, 6)
..MobileTelephoneNumber = Sheets('Sheet1').Cells(i, 8)
..HomeAddress = Sheets('Sheet1').Cells(i, 9)
..Body = Sheets('Sheet1').Cells(i, 10)
'close the new contact item form after saving:
'quit the Oulook application:
'clear the variables:
Set applOutlook = Nothing
Set nsOutlook = Nothing
Set ciOutlook = Nothing
Set delFolder = Nothing
Set delItems = Nothing
MsgBox 'Check in Outlook Contacts to make sure the record is created correctly', vbOK, 'Question'
Application.ScreenUpdating = True
Missing Microsoft Outlook 15.0 Object Library
Excel export to Outlook:- Missing Microsoft Outlook 16.0 object library Using assistance from online resources I have VBA to create an Outlook contact from an Excel spreadsheet. I was told the machines it was to work on were Office 2016, the same as I use. Note In Microsoft Visual C# 2005, click Visual C# under Project Types. Under Templates, click Console Application. By default, a file that is named Class1.cs is created. Note In Microsoft Visual C# 2005, Program.cs is created by default. Add a reference to either the Outlook 2002 Object Library or the Outlook 2003 Object Library. I'm trying to add a reference to 'Microsoft Outlook 16.0 Object Library' in a C#.NET 4.6.1 WPF project, because I have office 2016 installed. Previous versions of the Object Library are incompatible with the 2016 version of office. Had this issue before. My macro used the Microsoft Outlook 12.0 Object Library and was designed to work with that for all users of the team. However since an update to Office 365 was planned one of the IT guys had opened the macro with the new Office 365(and Microsoft Outlook 16.0 Object Library. Re: macro to fix missing:microsoft outlook 14.0 object library good - do you have the MSOUTL.OLB file there? If so, in the VBA area select tools references, click 'browse', and negotiate to that directory, click to select this file and your macros should work ok.