ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel and Word (https://www.excelbanter.com/excel-programming/315545-excel-word.html)

freddybee

Excel and Word
 

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

--
freddybe
-----------------------------------------------------------------------
freddybee's Profile: http://www.excelforum.com/member.php...fo&userid=1598
View this thread: http://www.excelforum.com/showthread.php?threadid=27453


Dick Kusleika[_4_]

Excel and Word
 
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(...)

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"freddybee" wrote in message
...

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
------------------------------------------------------------------------
freddybee's Profile:

http://www.excelforum.com/member.php...o&userid=15984
View this thread: http://www.excelforum.com/showthread...hreadid=274537





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com