I encountered a strange bug in Excel (both 2010 and 2016) such that if one bases a conditional format on the following VBA code:
Public Function uf_TEST_STATUS(r_range As Range, s_string As String) As Boolean
If r_range.Value2 <> “” Then
uf_TEST_STATUS = Application.ThisCell.Value2 <> s_string
Else
uf_TEST_STATUS = False
End If
End Function
the workbook won’t execute the Workbook_Open() event when the workbook is opened. Simply basing a conditional format on a user-defined function isn’t sufficient to disable the Workbook_Open() event though I have yet to figure out precisely what it is about the user-defined function that disables the Workbook_Open() event. However, I do know that it is what the user-defined function does internally, and not just the interface it presents to caller.