Hi,
I'm working with an Excel document-level customization that suddenly stopped working. Below some of the symptoms:
- In ThisWorkbook, event Me.Startup is not running.
- In the customization's ribbon, event MyBase.Load is not running.
Similar events in an Excel add-in are working as expected.
Below the development environment:
- Windows 11 Enterprise 64 bits
- Office 365 Version 2302 Build 16.0.16130.20848 64 bits
- .NET Framework 4.7.2
Below the ThisWorkbook code:
Public Class ThisWorkbook
Private Sub ThisWorkbook_Startup() Handles Me.Startup
Try
MessageBox.Show("Hi!")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub ThisWorkbook_Shutdown() Handles Me.Shutdown
End Sub
End Class
Below the ribbon code:
Imports Microsoft.Office.Tools.Ribbon
Public Class DemoRibbon
Private Sub DemoRibbon_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
Try
Dim x As Integer = 1 + 2
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub DemoButton_Click(sender As Object, e As RibbonControlEventArgs) Handles DemoButton.Click
MessageBox.Show("Hi!")
End Sub
End Class