• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 48
  • Last Modified:

Debugging a Word or Excel Add In

(relevant to Excel or Word)
In my Word application I have my VBA code in an Add In. The code manipulates text on ActiveDocument.

Unfortunately, (unlike in a macro-enabled document) this way, when I get an error I can't hit debug and go to the offending line of code - because it is in an Add In.
What is the normal/recommended way of setting up for debugging, so that I can go straight to the relevant line of code?

Thank you.
0
hindersaliva
Asked:
hindersaliva
  • 3
3 Solutions
 
Roy CoxGroup Finance ManagerCommented:
Unprotect the VBA Project.

In Excel or Word, open the VB Editor, from the Tools Menu select VBA ProjectProperties. In the Protection Tab you can uncheck Lock Project for viewing. You will need to know the password if one has been set.
0
 
hindersalivaAuthor Commented:
Hi Roy. The VBA Project is not protected.
From the Document the VBA Project is not viewable as it's a Word Add In.
0
 
hindersalivaAuthor Commented:
Also, I tried keeping the Add In open when the error occurs. Same.
0
 
GrahamSkanRetiredCommented:
If you have the code, try running it as a VBA macro under the same circumstances.
0
 
hindersalivaAuthor Commented:
Sorry, it's my Doh! moment.
I had forgotten how simple .........
Thanks for the hint Graham.
I opened the Add In. Made the document the Active Document. Ran the code from the IDE.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now