question

DanielXiaoDan-2510 avatar image
1 Vote"
DanielXiaoDan-2510 asked DanXiao-7645 answered

My C# program hit the error "Word cannot load the OLE 2.0 or Docfile library"

I am writing a piece of C# codes to open a Microsoft Word application, as shown below:

................................................................................................................................................................................................................................
Microsoft.Office.Interop.Word._Application wordApp = new Word.Application();
................................................................................................................................................................................................................................

But the C# codes hit the error message "Word cannot load the OLE 2.0 or Docfile library" (see the screenshot below)
103804-word-cannot-load-the-ole20-or-docfile-library.jpg



Can anybody help to provide a solution to this issue? Do I need to install the latest update of Microsoft Word 16.0? Or even do I need to re-install Microsoft Office?

Thank you.

Rgds,
Daniel

dotnet-csharpoffice-word-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DanielXiaoDan-2510
Does this problem occur only when using this code?
If you use the Word client, will you encounter such a problem?

0 Votes 0 ·
DuaneArnold-0443 avatar image
0 Votes"
DuaneArnold-0443 answered

I would say take the error message and search Bing or Google on what others have done to resolve the issues. You are not the only one that has faced the issue. I would also find out how to install the two items your program is looking for use Bing or Google.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DanXiao-7645 avatar image
1 Vote"
DanXiao-7645 answered

Hi, DuaneArnold-0443,

I have tried to uninstall & reinstall the latest version Microsoft Office 365, but the issue is still persisting.

Actually I have googled some websites, but most posts are applicable to Mac OS or iMac environment, but my computer is based on Windows 10. Some posts advise to uninstall & reinstall Microsoft Office, which I have done already. Therefore they are basically helpless.

Below I give you some examples of the googled URLs:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_mac-mso_mac2016/error-message-opening-word-cannot-load-ole-20-or/bcbfd38b-4c13-44ee-a079-220c65ecd194
https://www.windowsphoneinfo.com/threads/error-word-cannot-load-the-ole-2-0-or-docfile-libraries.308237/
https://www.justanswer.com/mac-computers/fxyc3-a-cannot-load-ole-2-0-docfile-libraries-shows.html
https://www.justanswer.com/mac-computers/fxyj2-2nd-opinion-not-close-cannot-load-ole-2-0-docfile.html
https://discussions.apple.com/thread/251693944

Can u please kindly try to provide some solutions to this issue?
Thanks.

Rgds,
Daniel

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.