PC Review


Reply
Thread Tools Rate Thread

Automation Problem

 
 
Joe Delphi
Guest
Posts: n/a
 
      18th Oct 2006
Hi,

I am attempting to automate MS Word from inside of my MS Access
program. Here is my code:

Private Sub cmdTest_Click()
Dim objWord As Word.Application
Dim objDoc As Word.Document

Set objWord = New Word.Application

objWord.Visible = True
End Sub

I am using early binding and at design time, everything is normal.
The code completion feature correctly completes Word.Application. It
compiles OK. But when I go to execution, it stops on the Set objWord = New
Word.Application line. The error message states: "Automation Error. The
specified module could not be found". In my References, I have the
following items checked:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6
Microsoft ActiveX Data Objects Library 2.8
Microsoft Office 11.0 Object Library
Microsoft Excel 11.0 Object Library
Microsoft Outlook 11.0 Object Library
Microsoft Word 11.0 Object Library

Can anyone tell me what I am doing wrong? Is there a reference that I have
left out that needs to be checked?


JD


 
Reply With Quote
 
 
 
 
Van T. Dinh
Guest
Posts: n/a
 
      18th Oct 2006
Not sure about your Set ... New statement. I tend to use CreateObject when
I do automation like:

Set xlApp = CreateObject("Excel.Application")


--
HTH
Van T. Dinh
MVP (Access)



"Joe Delphi" <(E-Mail Removed)> wrote in message
news:BtfZg.3245$xI4.3034@fed1read11...
> Hi,
>
> I am attempting to automate MS Word from inside of my MS Access
> program. Here is my code:
>
> Private Sub cmdTest_Click()
> Dim objWord As Word.Application
> Dim objDoc As Word.Document
>
> Set objWord = New Word.Application
>
> objWord.Visible = True
> End Sub
>
> I am using early binding and at design time, everything is normal.
> The code completion feature correctly completes Word.Application. It
> compiles OK. But when I go to execution, it stops on the Set objWord =
> New Word.Application line. The error message states: "Automation
> Error. The specified module could not be found". In my References, I
> have the following items checked:
>
> Visual Basic for Applications
> Microsoft Access 11.0 Object Library
> OLE Automation
> Microsoft DAO 3.6
> Microsoft ActiveX Data Objects Library 2.8
> Microsoft Office 11.0 Object Library
> Microsoft Excel 11.0 Object Library
> Microsoft Outlook 11.0 Object Library
> Microsoft Word 11.0 Object Library
>
> Can anyone tell me what I am doing wrong? Is there a reference that I
> have left out that needs to be checked?
>
>
> JD
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access automation leaves Excel open which in turn locks 2nd automation attempts EagleOne@discussions.microsoft.com Microsoft Access 8 30th Jun 2008 01:27 AM
Outlook Automation Automation Problem Out of Memory MikeA Microsoft Outlook VBA Programming 7 30th Jul 2007 02:31 PM
Automation problem =?Utf-8?B?VGltIExvbmc=?= Microsoft Excel Programming 5 20th Jul 2005 03:51 PM
Automation Problem Alan B. Densky Microsoft Access VBA Modules 0 10th Sep 2004 10:28 AM
Automation problem Ron Freudenheim Microsoft Access VBA Modules 3 30th Jan 2004 08:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 PM.