![]() |
#1
|
|||
|
|||
![]() Hello, I know very little VBA but I am working on a project. I received help from another user and the code he gave me keeps returning "compile error: Expected End Sub" error message. I have the "End Sub" at the end of the code. What should I do? |
#2
|
||||
|
||||
![]()
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) Code:
End Select Code:
Next lnglndex Code:
If Not "IsNull(arrData(0, lnglndex" Then Code:
If Not IsNull(arrData(0, lnglndex)) Then 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 |
#3
|
|||
|
|||
![]()
Yes, it def is one of his codes he has helped me with. Thanks!
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile error in hidden module: Tools | rafikiphoto | Excel | 2 | 01-16-2023 07:40 AM |
![]() |
ksigcajun | Word VBA | 2 | 04-08-2015 06:44 AM |
compile error in save code | tintin007 | Word VBA | 8 | 11-18-2014 03:49 AM |
Compile error: sub or function not defined.. | xena2305 | Excel Programming | 0 | 08-02-2011 10:17 AM |
compile error in Word | raco | Word | 0 | 09-28-2010 12:40 PM |