The error is caused by having two macro name rows. The first one has no corresponding end sub and should be deleted
Code:
Sub ContentControlOnEnter()
Private Sub Document_ContentControlOnEnter(ByVal oCC As ContentControl)
There should also be an
line after
There is also an error in the line
Code:
If Not "IsNull(arrData(0, lnglndex" Then
which I suggest should be
Code:
If Not IsNull(arrData(0, lnglndex)) Then
The variable arrData has not been declared. Put Option Explicit at the top of your VBA modules to force the declaration of variables, which will make errors easier to find. You can set this as the default in VBA Tools > Options > Editor. It will then add Option Explicit when you add a module to your projects.
This looks like code from my old friend Greg Maxey. Check the source of the code again and make sure you copy it correctly and don't screw it up when you make changes.
When posting code copy and paste the code from the editor, select it and use the # button to add CODE tags.