0

I've written a macro in Excel VBA, which I have used many times before. Today I loaded it up and it wants me to define all the variables (before I let Excel auto-assign everything). When I assigned all the variables, it then didn't recognize simple VBA functions like trim, split, again which it always has before.

I'm not using option explicit. Any idea what my problem could be?

It might have something to do with a recently installed a trial Excel addin (from a respectable company), the trial ran out and I uninstalled the addin, now none of my macros work.

5
  • Have you tried exporting the module, removing it and then importing it? Commented Oct 30, 2014 at 10:27
  • 3
    check the references if there is one marked as missing. ... and yes, you ALWAYS should use option explicit ;-) Commented Oct 30, 2014 at 10:32
  • removed it and imported it, that didnt make a difference :( Commented Oct 30, 2014 at 10:34
  • check the references if there is one marked as missing As @cboden mentioned did you check that? Commented Oct 30, 2014 at 10:35
  • cboden - it was the references. It appears the addin I uninstalled still had references ticked in the list. When I unchecked them, it worked again. Thanks for the help Commented Oct 30, 2014 at 10:38

1 Answer 1

-1

did you try turning off the OPTION Explicit requirement in the VBA Options:

To do this go into the VBA editor ─► Tools ─► Options ─► Editor ─► uncheck Require Variable Declaration.

Sign up to request clarification or add additional context in comments.

2 Comments

The OP already mentioned he didn't have Option Explicit enabled, but switching it off is not a solution, it would only hide problems.
Dave - he didn't say that he didn't have it enabled ... he said he wasn't using it .... which means that he did not have the OPTION EXPLICIT command at the top of his script module. These are two different things. Right or wrong ... It sounds to me that he wants if off because he has not defined his variables in any of his scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.