unable to load Add-In in Word when started from Excel vba

User avatar
Charles Kenyon
5StarLounger
Posts: 612
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

unable to load Add-In in Word when started from Excel vba

Post by Charles Kenyon »

I do not know if anyone here wants to tackle this one.
I am cross-posting on an issue I have not been able to resolve and I need to head off to court.
The original post is here:
https://answers.microsoft.com/en-us/mso ... 49f94efc1a

User avatar
HansV
Administrator
Posts: 78437
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: unable to load Add-In in Word when started from Excel vb

Post by HansV »

Hi Charles,

1) The reason that Astrid's code didn't run on your PC was that you hadn't set a reference to the Microsoft Word n.0 Object Library in Tools > References...

2) I downloaded and installed your test add-in.
When I start Word manually, the TEST TAB is visible in the ribbon. See 1. in the screenshot below.
When I start Word using Automation from Excel, the custom tab is NOT visible. See 2. in the screenshot.
S2672.png
I am using Word 2019 32-bit on Windows 10 Home 64-bit.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Charles Kenyon
5StarLounger
Posts: 612
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: unable to load Add-In in Word when started from Excel vb

Post by Charles Kenyon »

Thank you Hans,

Slight correction...
It works fine on my machine, not on Astrid's and her other installations.

The reason it works on my machine might be that I do have a reference to the Office Object Model.
00 deleteme 2.png
However, I tried turning it off on my machine and the Add-In still works.
Please respond in the Answers thread if you can.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78437
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: unable to load Add-In in Word when started from Excel vb

Post by HansV »

Hi Charles,

I was referring to your remark
This is your code, patched:

Sub StartWDFromXL()

Dim oWdApp 'As Word.Application
Dim oWdDoc 'As Word.Document
The code didn't need patching, you needed to set a reference to the Microsoft Word 16.0 Object Library, then it would have worked with

Code: Select all

Sub StartWDFromXL()

Dim oWdApp As Word.Application
Dim oWdDoc As Word.Document
Best wishes,
Hans

User avatar
Charles Kenyon
5StarLounger
Posts: 612
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: unable to load Add-In in Word when started from Excel vb

Post by Charles Kenyon »

OK, Thanks, Hans.

In the original Answers thread, you and others have replicated the problem even though I have not.

It may be due to slight differences in various releases, or not.