View Single Post
 
Old 07-12-2017, 08:58 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Code:
End Select
line after
Code:
Next lnglndex
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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote