A family of Microsoft word processing software products for creating web, email, and print documents.
Try my code and see what happens.
Again, on my system, the Add-ins load and are active. The Ribbon modifications happen.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an add-in (dotm template) which is stored in Word's Startup folder. Among other things it contains a customized ribbon.
This works fine, no problems when Word is started from the menu, double clicking a document etc. The add-in is loaded and the customizations in the ribbon are visible.
However if Word is started from VBA within another application (Excel or Access) the customizations in the ribbon do not show. If I check in the Developer tab the Add-in is listed and is selected as well.
Even if I unselected it (unload) and select (load) it again from the interface, the customized ribbon does not show.
This worked fine in Office 2010 with the exact same Excel VBA code and the same add-in.
Why does it not work in Office 2016?
Version 1904
Build 11601.20178
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Try my code and see what happens.
Again, on my system, the Add-ins load and are active. The Ribbon modifications happen.
The problem is not that the code does not run, the problem is that the add-in that is in the startup folder is not loaded.
The interface says its loaded (in tab Developer) but the ribbon customizations are not visible.
This is your code, patched:
Sub StartWDFromXL()
Dim oWdApp 'As Word.Application
Dim oWdDoc 'As Word.Document
On Error Resume Next
Set oWdApp = GetObject(, "Word.Application")
If Err Then
Set oWdApp = CreateObject("Word.Application")
Err.Clear
End If
On Error GoTo Err_Handler
oWdApp.Visible = True
oWdApp.Activate
Set oWdDoc = oWdApp.Documents.Add
oWdDoc.Range.Text = "New Doc"
Set oWdApp = Nothing
Set oWdDoc = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Number & " " & Err.Description
End Sub
It runs and creates the new document on my system.
Reference to the Word library?
Hi Astrid,
Haven't had a chance to go through this fully. This is from a first try: