Beginner here....
I have an Excel spreadsheet at work the opens every morning when I turn on the PC. The "spreadsheet" is nothing other than a VBA module that opens a number of programs on my PC. I am having a bear of a time getting it to open Outlook, though.
Several versions of code I have tried are:
Dim myOlApp as New Outlook.Application
Set myspace = myOlApp.GetNameSpace("MAPI")
or
Dim myOlApp as Outlook.Application
Set myOlApp as New Outlook.Application
Set myspace = myOlApp.GetNameSpace("MAPI")
or
Dim myOlApp
Set myOlApp = CreateObject("Outlook.Application")
Set myspace = myOlApp.GetNameSpace("MAPI")
Every time I try to run my code I get a Visual Basic pop-up which says:
Run-time error [long # follows]
Automation error
The specified module could not be found
The highlighted line of code is always the first one AFTER my Dim statement which employs "myOlApp".
Now, I HAVE CHECKED OFF the Tools/Reference boxes for MSFT Outlook 11.0 object library and have moved it to the the 3rd position in terms of priority among my Reference libraries. Further, if I go into Object Browser all of the objects, procedures, etc. for Outlook are there.
I have tried numerous permutations of the code above - all of which abort with the same "module not found"
VB pop-up message.
Help!
ArtDecade