I have code which has worked great on 3 different computers over the years. Now I am getting an error message on my latest computer. The code is for a macro that will select a specific contact view (I've got several different views and the project has several subs to view each of these). I am getting a compile error with the message - can't find project or library. Any help would be appreciated.
Sub GetViewChurch()
'Selects a new view
Dim olApp As Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim objName As NameSpace
Dim objViews As Views
Dim objView As View
Dim myolapp As Outlook.Application
Dim mynamespace As NameSpace
Set myolapp = CreateObject("Outlook.Application")
Set mynamespace = myolapp.GetNamespace("MAPI")
Set myolapp.ActiveExplorer.CurrentFolder = mynamespace.GetDefaultFolder(olFolderContacts)
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set myOlExp = olApp.ActiveExplorer
Set myFolder = objName.GetDefaultFolder(olFolderContacts) <<<<<<========= error here
Set myExplorer = myFolder.GetExplorer
'myExplorer.Display
Set objViews = objName.GetDefaultFolder(olFolderContacts).Views
myOlExp.CurrentView = "Church"
End Sub
Sub GetViewChurch()
'Selects a new view
Dim olApp As Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim objName As NameSpace
Dim objViews As Views
Dim objView As View
Dim myolapp As Outlook.Application
Dim mynamespace As NameSpace
Set myolapp = CreateObject("Outlook.Application")
Set mynamespace = myolapp.GetNamespace("MAPI")
Set myolapp.ActiveExplorer.CurrentFolder = mynamespace.GetDefaultFolder(olFolderContacts)
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set myOlExp = olApp.ActiveExplorer
Set myFolder = objName.GetDefaultFolder(olFolderContacts) <<<<<<========= error here
Set myExplorer = myFolder.GetExplorer
'myExplorer.Display
Set objViews = objName.GetDefaultFolder(olFolderContacts).Views
myOlExp.CurrentView = "Church"
End Sub