473,479 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Outlook CreateObject question

I have the following code. I have a reference to the Outlook library in
the reference list. My machine is standalone, not on a network.

Dim Olapp As Outlook.Application
Set Olapp = CreateObject("Outlook.Application")

This blows up with the message "Automation error, the specified module
could not be found."

If I change it to

Dim Olapp As Outlook.Application
or
Dim Olapp As Object
Set Olapp = GetObject(, "Outlook.Application")

then it works fine as long as Outlook is open.

Why does the above work but the CreateObject line fail?
Apr 3 '07 #1
9 5121
salad wrote:
I have the following code. I have a reference to the Outlook library
in the reference list. My machine is standalone, not on a network.

Dim Olapp As Outlook.Application
Set Olapp = CreateObject("Outlook.Application")

This blows up with the message "Automation error, the specified module
could not be found."

If I change it to

Dim Olapp As Outlook.Application
or
Dim Olapp As Object
Set Olapp = GetObject(, "Outlook.Application")

then it works fine as long as Outlook is open.

Why does the above work but the CreateObject line fail?
If you use late binding (good idea) then create all objects as objects.

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

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 3 '07 #2
Rick Brandt wrote:
salad wrote:
>>I have the following code. I have a reference to the Outlook library
in the reference list. My machine is standalone, not on a network.

Dim Olapp As Outlook.Application
Set Olapp = CreateObject("Outlook.Application")

This blows up with the message "Automation error, the specified module
could not be found."

If I change it to

Dim Olapp As Outlook.Application
or
Dim Olapp As Object
Set Olapp = GetObject(, "Outlook.Application")

then it works fine as long as Outlook is open.

Why does the above work but the CreateObject line fail?


If you use late binding (good idea) then create all objects as objects.
In google groups it seems that some people experience the same error I
do while others do not.
>
Dim Olapp As Object
Set Olapp = CreateObject("Outlook.Application")
I get the same error "Automation error, the specified module could not
be found." with or without the Outlook Libary checked under
Tools/References it I use your method calling CreateObject. GetObject
works fine as long as Outlook is open.

Apr 3 '07 #3
salad wrote:
In google groups it seems that some people experience the same error I
do while others do not.
>>
Dim Olapp As Object
Set Olapp = CreateObject("Outlook.Application")

I get the same error "Automation error, the specified module could not
be found." with or without the Outlook Libary checked under
Tools/References it I use your method calling CreateObject. GetObject
works fine as long as Outlook is open.
I had one user getting that error and it was fixed by doing a repair install
of Office on her PC.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 3 '07 #4
Rick Brandt wrote:
salad wrote:
>>In google groups it seems that some people experience the same error I
do while others do not.

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

I get the same error "Automation error, the specified module could not
be found." with or without the Outlook Libary checked under
Tools/References it I use your method calling CreateObject. GetObject
works fine as long as Outlook is open.


I had one user getting that error and it was fixed by doing a repair install
of Office on her PC.
That could be my case. One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both Offices and
reinstalled 97 but I installed it in another subfolder than the default.
Somehow I had 2 versions of A97 on the machine and I spent hours
trying to correct it. I finally got A97 back on but can't to this day
install service pack 2. I figure someday I'll get a new computer and I
won't have that problem with multiple versions of Access and perhaps
multiple crossfolder Access 97s and that problem will go away.
Apr 3 '07 #5
salad <oi*@vinegar.comwrote in
news:XB********************@newsread2.news.pas.ear thlink.net:
One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both
Offices and reinstalled 97 but I installed it in another subfolder
than the default.
Somehow I had 2 versions of A97 on the machine and I spent hours
trying to correct it. I finally got A97 back on but can't to this
day install service pack 2. I figure someday I'll get a new
computer and I won't have that problem with multiple versions of
Access and perhaps multiple crossfolder Access 97s and that
problem will go away.
Have you tried the Office 97 Eraser program? That's how I've always
been able to clean up failed/corrupted Office installations that
wouldn't completely uninstall themselves.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 4 '07 #6
David W. Fenton wrote:
salad <oi*@vinegar.comwrote in
news:XB********************@newsread2.news.pas.ear thlink.net:

>One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both
Offices and reinstalled 97 but I installed it in another subfolder
than the default.
Somehow I had 2 versions of A97 on the machine and I spent hours
trying to correct it. I finally got A97 back on but can't to this
day install service pack 2. I figure someday I'll get a new
computer and I won't have that problem with multiple versions of
Access and perhaps multiple crossfolder Access 97s and that
problem will go away.


Have you tried the Office 97 Eraser program? That's how I've always
been able to clean up failed/corrupted Office installations that
wouldn't completely uninstall themselves.
I have NEVER heard of that program. I read some KB articles and did my
best to rid O97 using the recommendations. Is is a MS program or
external 3rd party program?
Apr 4 '07 #7
salad <oi*@vinegar.comwrote in
news:gT******************@newsread4.news.pas.earth link.net:
David W. Fenton wrote:
>salad <oi*@vinegar.comwrote in
news:XB********************@newsread2.news.pas.ea rthlink.net:

>>One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both
Offices and reinstalled 97 but I installed it in another
subfolder than the default.
Somehow I had 2 versions of A97 on the machine and I spent
hours
trying to correct it. I finally got A97 back on but can't to
this day install service pack 2. I figure someday I'll get a new
computer and I won't have that problem with multiple versions of
Access and perhaps multiple crossfolder Access 97s and that
problem will go away.

Have you tried the Office 97 Eraser program? That's how I've
always been able to clean up failed/corrupted Office
installations that wouldn't completely uninstall themselves.
I have NEVER heard of that program. I read some KB articles and
did my best to rid O97 using the recommendations. Is is a MS
program or external 3rd party program?
It's a Microsoft program. If you can't find it in the Knowledge
Base, I can put it up on my website for download.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 4 '07 #8
salad <oi*@vinegar.comwrote in
news:gT******************@newsread4.news.pas.earth link.net:
David W. Fenton wrote:
>salad <oi*@vinegar.comwrote in
news:XB********************@newsread2.news.pas.ea rthlink.net:

>>One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both
Offices and reinstalled 97 but I installed it in another
subfolder than the default.
Somehow I had 2 versions of A97 on the machine and I spent
hours
trying to correct it. I finally got A97 back on but can't to
this day install service pack 2. I figure someday I'll get a new
computer and I won't have that problem with multiple versions of
Access and perhaps multiple crossfolder Access 97s and that
problem will go away.


Have you tried the Office 97 Eraser program? That's how I've
always been able to clean up failed/corrupted Office
installations that wouldn't completely uninstall themselves.
I have NEVER heard of that program. I read some KB articles and
did my best to rid O97 using the recommendations. Is is a MS
program or external 3rd party program?
I should have checked my hard drive -- I had very cleverly saved a
link to the KB article for it!

(sometimes I'm so smart it kills me ;)

Here's the KB article, with a download link for the eraser utility:

http://support.microsoft.com/kb/q176823/

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 4 '07 #9
David W. Fenton wrote:
salad <oi*@vinegar.comwrote in
news:gT******************@newsread4.news.pas.earth link.net:

>>David W. Fenton wrote:
>>>salad <oi*@vinegar.comwrote in
news:XB********************@newsread2.news.pas. earthlink.net:

One time I had O2K on my machine and had a
problem with Import/Export stuff on A97. I uninstalled both
Offices and reinstalled 97 but I installed it in another
subfolder than the default.
Somehow I had 2 versions of A97 on the machine and I spent
hours
trying to correct it. I finally got A97 back on but can't to
this day install service pack 2. I figure someday I'll get a new
computer and I won't have that problem with multiple versions of
Access and perhaps multiple crossfolder Access 97s and that
problem will go away.
Have you tried the Office 97 Eraser program? That's how I've
always been able to clean up failed/corrupted Office
installations that wouldn't completely uninstall themselves.

I have NEVER heard of that program. I read some KB articles and
did my best to rid O97 using the recommendations. Is is a MS
program or external 3rd party program?


I should have checked my hard drive -- I had very cleverly saved a
link to the KB article for it!

(sometimes I'm so smart it kills me ;)

Here's the KB article, with a download link for the eraser utility:

http://support.microsoft.com/kb/q176823/
Thanks, David.
Apr 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4973
by: deko | last post by:
When adding Outlook Appointment Items from Access, should I use: Set ol = New Outlook.Application --or-- Set ol = CreateObject("Outlook.Application") Outlook seems to crash either way. The...
1
1709
by: Tom Glasser | last post by:
I have the following code in my Access application: Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail =...
4
4161
by: digger27 | last post by:
I am trying to progamatically create tasks in Outlook using VB.Net. I am using the following code: **** Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
5
3905
by: Siv | last post by:
Hi, A little while ago I asked if anyone could help me with how to create an email using MS Outlook that contained an embedded picture file. Thanks to Jay Harlow I was able to get this working...
3
8263
by: wizzbangca | last post by:
Hi everyone. Having problems with a utility I am writing for work. The previous IT Director thoughtfully allowed 3 (2000, xp, 2003) versions of outlook to be installed rather than 1. Now I need...
7
4909
by: John | last post by:
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...
5
5334
by: Kosmos | last post by:
I have traveled the world and the seven seas and I have yet to come up with an answer to this question.... So I'm adding an attachment to an email from access... The following is the code: ...
2
5111
by: dlesandrini | last post by:
Now that I have my rant about Google Search out of the way, I can ask my question. Someone must have noticed this, but since I can't Google the Access groups about it, I'll have to just ask: ...
9
2235
by: ARC | last post by:
In case anyone has ran into this yet. The following code used to work with older versions of the MS Outlook library, but would error out in 2007: Dim objOutlook As Outlook.Application Dim...
0
7027
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7019
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.