Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Outlook object stopped working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
muyBN - 25 Aug 2006 00:33 GMT
RunI have a Word document that I attach to an Outlook message with VBA. As
of yesterday, it all of a sudden quit working after about two months of
working just fine. I've closed and re-opened Word and Outlook, restarted the
computer, everything I could think of, but still get this error:

Run-time error '429':

Active-X component can't create object

Any ideas on how to resolve this, and why it would go inoperable from one
day to the next?
Signature

Bryan

muyBN - 25 Aug 2006 00:48 GMT
Actually, I solved the 491 error, but now I'm getting this one:

Run-time error '91':

Object variable or With block variable not set

Following is the line where the error occurs; after that, I'll write the
complete section of code.

Set objItem = objOutlookApp.CreateItem(olMailItem)

   On Error Resume Next
   Set objOutlookApp = GetObject(, "Outlook.Application")
   On Error GoTo 0
   If Err <> 0 Then
       Set objOutlookApp = CreateObject("Outlook.Application")
       blnStarted = True
   End If
   Set objItem = objOutlookApp.CreateItem(olMailItem)

Signature

Bryan

> RunI have a Word document that I attach to an Outlook message with VBA. As
> of yesterday, it all of a sudden quit working after about two months of
[quoted text clipped - 7 lines]
> Any ideas on how to resolve this, and why it would go inoperable from one
> day to the next?
Jezebel - 25 Aug 2006 01:51 GMT
The problem is that you are failing to instantiate objOutlookApp. The
mistake in your code is here

>    On Error GoTo 0
>    If Err <> 0 Then

All 'On error' statements clear the error object, so Err will always be zero
at this point. As you have it, the code will work if Outlook is already
running, but not otherwise. A simple fix is to use

   On Error Resume Next
   Set objOutlookApp = GetObject(, "Outlook.Application")
   On Error GoTo 0
   If objOutlookApp  is nothing then
       ...

> Actually, I solved the 491 error, but now I'm getting this one:
>
[quoted text clipped - 29 lines]
>> Any ideas on how to resolve this, and why it would go inoperable from one
>> day to the next?
muyBN - 25 Aug 2006 07:37 GMT
That was the trick. Thanks.
Signature

Bryan

> The problem is that you are failing to instantiate objOutlookApp. The
> mistake in your code is here
[quoted text clipped - 45 lines]
> >> Any ideas on how to resolve this, and why it would go inoperable from one
> >> day to the next?
muyBN - 28 Aug 2006 05:07 GMT
Well, durn, it worked once then gave an error again (something like "module
couldn't be created"); now I just tried it again so I could get the exact
error code, then it worked! Does anyone have ideas on why it would work once
then not the next time? Here's the code:

   On Error Resume Next
   Set objOutlookApp = GetObject(, "Outlook.Application")
   On Error GoTo 0
   If objOutlookApp Is Nothing Then
       Set objOutlookApp = CreateObject("Outlook.Application")
       blnStarted = True
   End If

Signature

Bryan

> That was the trick. Thanks.
>
[quoted text clipped - 47 lines]
> > >> Any ideas on how to resolve this, and why it would go inoperable from one
> > >> day to the next?
Russ - 02 Sep 2006 23:37 GMT
muyBN,

I'm new to invoking another app with code, but it might be that you need to
set objOutlookApp = Nothing to release it from memory when your done with it
before trying to create or set it again.

> Well, durn, it worked once then gave an error again (something like "module
> couldn't be created"); now I just tried it again so I could get the exact
[quoted text clipped - 8 lines]
>         blnStarted = True
>     End If

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.