Problem automating outlook

Hi

I am using the following code to automate outlook from within MS Access;

Dim O As Object
O = CreateObject("Outlook.Application")

The problem is that I am getting the following error on the second line;

Automation error
The specified module can not be found

What is the problem and how can I fix it?

Thanks

Regards 


0
john6244 (170)
3/26/2006 4:05:46 AM
outlook 87535 articles. 10 followers. Follow

5 Replies
372 Views

Similar Articles

[PageSpeed] 29

Dim O As Object
Set O = CreateObject("Outlook.Application")


Regards
Mark Dormer





"John" <John@nospam.infovis.co.uk> wrote in message 
news:eFs9QqIUGHA.1236@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I am using the following code to automate outlook from within MS Access;
>
> Dim O As Object
> O = CreateObject("Outlook.Application")
>
> The problem is that I am getting the following error on the second line;
>
> Automation error
> The specified module can not be found
>
> What is the problem and how can I fix it?
>
> Thanks
>
> Regards
> 


0
markd6876 (12)
3/26/2006 5:45:53 AM
I wasn't getting an error using the
Set O = CreateObject("Outlook.Application")


Perhaps it is something else in your code?
If you want paste it all.


FWIW I use this method.
In the VB Editor goto Tools - References and Add Microsoft Outlook 11.0 
Library

Sub test()
  Set ol = New Outlook.Application
  Set olns = ol.GetNamespace("MAPI")
  Set objFolder = olns.GetDefaultFolder(olFolderContacts)
End Sub



Regards
Mark Dormer



"John" <John@nospam.infovis.co.uk> wrote in message 
news:eGSM5BOUGHA.4608@tk2msftngp13.phx.gbl...
>I am now using;
>
> Set O = CreateObject("Outlook.Application")
>
> and I am getting the attached error. Outlook 2003 seems to be working fine
> otherwise. I have also done a detect and repair on it as well.
>
> Regards
>
>
> "Mark Dormer" <markd@mvpsx.org> wrote in message 
> news:OQnGOiJUGHA.776@TK2MSFTNGP09.phx.gbl...
>> Dim O As Object
>> Set O = CreateObject("Outlook.Application")
>>
>>
>> Regards
>> Mark Dormer
>>
>>
>>
>>
>>
>> "John" <John@nospam.infovis.co.uk> wrote in message
>> news:eFs9QqIUGHA.1236@TK2MSFTNGP11.phx.gbl...
>>> Hi
>>>
>>> I am using the following code to automate outlook from within MS Access;
>>>
>>> Dim O As Object
>>> O = CreateObject("Outlook.Application")
>>>
>>> The problem is that I am getting the following error on the second line;
>>>
>>> Automation error
>>> The specified module can not be found
>>>
>>> What is the problem and how can I fix it?
>>>
>>> Thanks
>>>
>>> Regards
>>>
>>
>>
>
>
> 


0
markd6876 (12)
3/27/2006 1:40:30 AM
If you get an error from a code statement like this:=20

    Set ol =3D CreateObject("Outlook.Application")

the cause may be an anti-virus program on your computer that has a =
feature to block Outlook scripting. The solution is to turn off the =
script blocking feature.=20
            =20
If you're using Symantec Anti Virus, make a backup of the Windows =
registry, and then see if these changes solve the problem:=20

1. Go to the HKEY_CLASSES_ROOT\Outlook.Application\CLSID key and note =
the (Default) value. It will be a GUID, most likely =
{0006F03A-0000-0000-C000-000000000046}.

2. Now go to the key =
HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocServ=
er32 key, using the value from Step 1 if it's different from that shown =
above.=20

3. For the (Default) for that key, you should see this value:
=20
    C:\Program Files\Common Files\Symantec Shared\Script =
Blocking\ScrBlock.dll

Delete that text, so that the key's (Default) value becomes (value not =
set)


--=20
Sue Mosher, Outlook MVP
   Author of Configuring Microsoft Outlook 2003
     http://www.turtleflock.com/olconfig/index.htm
   and Microsoft Outlook Programming - Jumpstart for=20
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx
  =20
"Mark Dormer" <markd@mvpsx.org> wrote in message =
news:ezjjw9TUGHA.3192@TK2MSFTNGP09.phx.gbl...
>I wasn't getting an error using the
> Set O =3D CreateObject("Outlook.Application")
>=20
>=20
> Perhaps it is something else in your code?
> If you want paste it all.
>=20
>=20
> FWIW I use this method.
> In the VB Editor goto Tools - References and Add Microsoft Outlook =
11.0=20
> Library
>=20
> Sub test()
>  Set ol =3D New Outlook.Application
>  Set olns =3D ol.GetNamespace("MAPI")
>  Set objFolder =3D olns.GetDefaultFolder(olFolderContacts)
> End Sub
>=20
>=20
>=20
> Regards
> Mark Dormer
>=20
>=20
>=20
> "John" <John@nospam.infovis.co.uk> wrote in message=20
> news:eGSM5BOUGHA.4608@tk2msftngp13.phx.gbl...
>>I am now using;
>>
>> Set O =3D CreateObject("Outlook.Application")
>>
>> and I am getting the attached error. Outlook 2003 seems to be working =
fine
>> otherwise. I have also done a detect and repair on it as well.
>>
>> Regards
>>
>>
>> "Mark Dormer" <markd@mvpsx.org> wrote in message=20
>> news:OQnGOiJUGHA.776@TK2MSFTNGP09.phx.gbl...
>>> Dim O As Object
>>> Set O =3D CreateObject("Outlook.Application")
>>>
>>>
>>> Regards
>>> Mark Dormer
>>>
>>>
>>>
>>>
>>>
>>> "John" <John@nospam.infovis.co.uk> wrote in message
>>> news:eFs9QqIUGHA.1236@TK2MSFTNGP11.phx.gbl...
>>>> Hi
>>>>
>>>> I am using the following code to automate outlook from within MS =
Access;
>>>>
>>>> Dim O As Object
>>>> O =3D CreateObject("Outlook.Application")
>>>>
>>>> The problem is that I am getting the following error on the second =
line;
>>>>
>>>> Automation error
>>>> The specified module can not be found
>>>>
>>>> What is the problem and how can I fix it?
>>>>
>>>> Thanks
>>>>
>>>> Regards
>>>>
>>>
>>>
>>
>>
>>=20
>=20
>
0
suemvp (4038)
3/27/2006 12:27:53 PM
Apparently using

Set objOutlook = CreateObject("Outlook.Application","localhost")

fixes the problem. Not sure why though.

Regards


"Mark Dormer" <markd@mvpsx.org> wrote in message 
news:ezjjw9TUGHA.3192@TK2MSFTNGP09.phx.gbl...
>I wasn't getting an error using the
> Set O = CreateObject("Outlook.Application")
>
>
> Perhaps it is something else in your code?
> If you want paste it all.
>
>
> FWIW I use this method.
> In the VB Editor goto Tools - References and Add Microsoft Outlook 11.0 
> Library
>
> Sub test()
>  Set ol = New Outlook.Application
>  Set olns = ol.GetNamespace("MAPI")
>  Set objFolder = olns.GetDefaultFolder(olFolderContacts)
> End Sub
>
>
>
> Regards
> Mark Dormer
>
>
>
> "John" <John@nospam.infovis.co.uk> wrote in message 
> news:eGSM5BOUGHA.4608@tk2msftngp13.phx.gbl...
>>I am now using;
>>
>> Set O = CreateObject("Outlook.Application")
>>
>> and I am getting the attached error. Outlook 2003 seems to be working 
>> fine
>> otherwise. I have also done a detect and repair on it as well.
>>
>> Regards
>>
>>
>> "Mark Dormer" <markd@mvpsx.org> wrote in message 
>> news:OQnGOiJUGHA.776@TK2MSFTNGP09.phx.gbl...
>>> Dim O As Object
>>> Set O = CreateObject("Outlook.Application")
>>>
>>>
>>> Regards
>>> Mark Dormer
>>>
>>>
>>>
>>>
>>>
>>> "John" <John@nospam.infovis.co.uk> wrote in message
>>> news:eFs9QqIUGHA.1236@TK2MSFTNGP11.phx.gbl...
>>>> Hi
>>>>
>>>> I am using the following code to automate outlook from within MS 
>>>> Access;
>>>>
>>>> Dim O As Object
>>>> O = CreateObject("Outlook.Application")
>>>>
>>>> The problem is that I am getting the following error on the second 
>>>> line;
>>>>
>>>> Automation error
>>>> The specified module can not be found
>>>>
>>>> What is the problem and how can I fix it?
>>>>
>>>> Thanks
>>>>
>>>> Regards
>>>>
>>>
>>>
>>
>>
>>
>
> 


0
john6244 (170)
3/27/2006 1:51:04 PM
Apparently using

Set objOutlook = CreateObject("Outlook.Application","localhost")

fixes the problem. Not sure why though.

Regards

"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message 
news:ujMU14ZUGHA.1636@TK2MSFTNGP10.phx.gbl...
If you get an error from a code statement like this:

    Set ol = CreateObject("Outlook.Application")

the cause may be an anti-virus program on your computer that has a feature 
to block Outlook scripting. The solution is to turn off the script blocking 
feature.

If you're using Symantec Anti Virus, make a backup of the Windows registry, 
and then see if these changes solve the problem:

1. Go to the HKEY_CLASSES_ROOT\Outlook.Application\CLSID key and note the 
(Default) value. It will be a GUID, most likely 
{0006F03A-0000-0000-C000-000000000046}.

2. Now go to the key 
HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocServer32 
key, using the value from Step 1 if it's different from that shown above.

3. For the (Default) for that key, you should see this value:

    C:\Program Files\Common Files\Symantec Shared\Script 
Blocking\ScrBlock.dll

Delete that text, so that the key's (Default) value becomes (value not set)


-- 
Sue Mosher, Outlook MVP
   Author of Configuring Microsoft Outlook 2003
     http://www.turtleflock.com/olconfig/index.htm
   and Microsoft Outlook Programming - Jumpstart for
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx

"Mark Dormer" <markd@mvpsx.org> wrote in message 
news:ezjjw9TUGHA.3192@TK2MSFTNGP09.phx.gbl...
>I wasn't getting an error using the
> Set O = CreateObject("Outlook.Application")
>
>
> Perhaps it is something else in your code?
> If you want paste it all.
>
>
> FWIW I use this method.
> In the VB Editor goto Tools - References and Add Microsoft Outlook 11.0
> Library
>
> Sub test()
>  Set ol = New Outlook.Application
>  Set olns = ol.GetNamespace("MAPI")
>  Set objFolder = olns.GetDefaultFolder(olFolderContacts)
> End Sub
>
>
>
> Regards
> Mark Dormer
>
>
>
> "John" <John@nospam.infovis.co.uk> wrote in message
> news:eGSM5BOUGHA.4608@tk2msftngp13.phx.gbl...
>>I am now using;
>>
>> Set O = CreateObject("Outlook.Application")
>>
>> and I am getting the attached error. Outlook 2003 seems to be working 
>> fine
>> otherwise. I have also done a detect and repair on it as well.
>>
>> Regards
>>
>>
>> "Mark Dormer" <markd@mvpsx.org> wrote in message
>> news:OQnGOiJUGHA.776@TK2MSFTNGP09.phx.gbl...
>>> Dim O As Object
>>> Set O = CreateObject("Outlook.Application")
>>>
>>>
>>> Regards
>>> Mark Dormer
>>>
>>>
>>>
>>>
>>>
>>> "John" <John@nospam.infovis.co.uk> wrote in message
>>> news:eFs9QqIUGHA.1236@TK2MSFTNGP11.phx.gbl...
>>>> Hi
>>>>
>>>> I am using the following code to automate outlook from within MS 
>>>> Access;
>>>>
>>>> Dim O As Object
>>>> O = CreateObject("Outlook.Application")
>>>>
>>>> The problem is that I am getting the following error on the second 
>>>> line;
>>>>
>>>> Automation error
>>>> The specified module can not be found
>>>>
>>>> What is the problem and how can I fix it?
>>>>
>>>> Thanks
>>>>
>>>> Regards
>>>>
>>>
>>>
>>
>>
>>
>
> 


0
john6244 (170)
3/27/2006 1:51:16 PM
Reply:

Similar Artilces:

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <u8526505@gmail.com> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

Outlook 2007 and Windows 7
After installing Office 2007 on Windows 7 machine, I get no new mail sound, pop up notifications or the new unread mail icon in task bar. Every thing else seems to work fine. Any hints? are the icons in the overflow? -- -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM Poll: What v...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Outlook not sending messages from correct POP3 account
I am a tech support person, supporting several companies from my home. Therefore, I have several pop3 email accounts setup on my computer in Outlook. When I reply to an email, I need to make sure that the correct account shows up in the "From" field. This works for some messages, but for others, the email is sent from the wrong account (making me look real bad :-)). This happens even when it says it's going to be sent from the correct account, if I check the sent items afterward, I'll see that it was sent from the wrong account. This is driving me batty and I nee...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' (http://rapidshare.com/files/347103149/Minidump.rar.html) Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <guest@unknown-email.com> wrote in message news:0b9a0c60b90bf6c0be88bda30f2820ab@nntp-gateway.com... > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Outlook 2003 won't save password in pop3 account settings
I am trying to set my email account settings to remember my password and it still prompts me everytime I send or receive email for the password. If I type it in, I have no trouble connecting and getting mail though. I am working through a citrix terminal to connect to outlook 2003 running on our company server. Is this a known bug? Is there a patch? Help! Sean Cartwright ...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

Directory Replication Problem #2
Hi, recently my Exchange Server directory database receives changes from other servers but does not send out its own changes. Check from the knowledge base, to correct the USN discrepancy need to use Authrest.exe (need to amke changes for about 100+ users). Does anybody know where to get this file 'Authrest.exe' for exchange server 5.5? Exchange server 5.5 CD only provide this file for ver.4.0. Have anyone use it before? Regards, "Sharon Tan" <sharon_tansk@yahoo.com.sg> wrote: >Hi, recently my Exchange Server directory database >receives changes from ot...

Outlook won't open after reinstalling it after installing Windows
My computer crashed. I installed Windows 7, and then reinstalled Office 2007. Outlook will not open. Any suggestions? Margye Hixson Suggest providing information. Include what you did, what happened and any and all error messages. Be detailed as if we weren't there and don't know what happened. -- Russ Valentine "Margye" <Margye@discussions.microsoft.com> wrote in message news:9F85CAAC-2042-4CAB-A329-EF6B3A682189@microsoft.com... > My computer crashed. I installed Windows 7, and then reinstalled Office > 2007. > Outlook will not open....

Outlook rules and Junk Email filtering
Hello! I have a problem with Outlook 2003 SP3 and the Junk Email folder. I have filtering set to Low, and I get emails from a contact page on a web site that always have the same subject. Sometimes, those messages end up in the Junk Email folder, sometimes they end up in the Inbox. I created a rule that says for any email with that subject, move it to the Inbox and stop processing more rules. The problem is that some of the messages STILL end up in the Junk folder. So, how can I stop the Junk Email filter from moving these messages? Is there some hidden way to make them stay in the In...

Spelling in Outlook 2003
Hi NG In Outlook 2003 I can tell what language I want to use for spelling. I have chosen Danish. When I press "Check Spelling" the language is English. Why? Regards Jens What language version of Office do you have? --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 After furious head scratching, Jens asked: | Hi NG |=20 | In Outlook 2003 I can tell what language I want to use for spelling. | I have chosen Danish. When I press "Check Spel...

Cell Format
I have a spreadsheet with cells that I'm trying to type the date into. I type in the date exactly like this: 09/26/03. When I hit "enter" MS Excel displays "37890" in the cell. No matter what I do I can't the cell to show: 09/26/03. I think that somehow I need to "strip" the cell of what it's original format is, but I can't figure out how. I try to use the Date option in the format cell screen but it doesn't work. Curtis I tried this and it didn't work. I also tried the "Text to columns" feature. No success. >...

User Defined Variables in MS query cause a problem to import data
If I use user defined variables in MS query to import data into excel sheet, the query executes but no data gets imported into the excel sheet. If I get rid of the variable the results can be imported into the Excel sheet. ...

outlook web access redirect problem
hi, I have been trying to redirect outlook web access (OWA) from the IIS root folder to the /exchange folder. I have followed the instructions on going into the web site and redirecting to a folder but I just get the following URL when I browse to the root of my webserver : http://webmail/exchange/exchange - it's like it's doubling up somehow. I have it set to : A redirection to a URL redirect to: /exchange client will be sent to: A directory below URL entered I just can't work it out... any ideas... cheers Baronne Which instructions did you follow? I wrote the below articl...

Need to Hire Outlook 2003 Help
Hi I'd like to hire someone that can walk me through some specific stuff with outlook 2003 I'm using the Lotus Notes to Outlook plugin My compnay is a Notes shop - which means I get NO support for outlook --- this plugin is a god send and i want to make sure I get it set up correctly It's coming out of my pocket but I'm willing to pay if I can find the right person to help me Please post ideas here or email me Thanks Brendan ...