Excel and Word

  • Thread starter Thread starter freddybee
  • Start date Start date
F

freddybee

Bonjour,

Hi,

I was trying to export data from Excel to Word and

1) I have set a reference to Microsoft Word 11.0 Object Library in VBA

2) The begining of the code is

Dim appWrd As Object
Set appWrd = CreateObject("Word.Document")

But HERE when I test, I have a message saying

Err -2147221231
Err Automation
ClassFactory can't provide the requested class

(free translation of the original message in french)

AND I DO NOT UNDERSTAND WHY :confused:

THANKS IN ADVANCE FOR YOUR HELP / SUPPORT :cool
 
freddybee

Change "Word.Document" to "Word.Application"

If you then want to get to a document, you can

Dim doc as Object

Set doc = appWrd.Documents.Open(...)
 

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

Back
Top