Automation Problem

J

Joe Delphi

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
 
V

Van T. Dinh

Not sure about your Set ... New statement. I tend to use CreateObject when
I do automation like:

Set xlApp = CreateObject("Excel.Application")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top