Compile Error: variable not defined
Did you distribute it as an entire workbook or did the users have to copy the
code into another workbook? If the latter, then they could have 'Require
variable declaration' turned on in VBA Options which in turn places 'Option
Explicit' at the top of each module in VBA when it is initially opened.
With your copy, ensure that Option Explicit is at the top of each module and
try compiling the code again from the Debug menu option and it will probably
show you what variable is not defined.
If this is not the problem then I am fresh out of ideas.
--
Regards,
OssieMac
"JHop" wrote:
I just distributed a new version of a complex workbook with lots of VBA code
to users who had been running an earlier version. I made some changes to the
code, tested the new version rigorously before sending it out, and it ran
fine. Now at least 2 users are reporting that they get a "Compile error:
variable not defined" when they try to run the main macro. I rechecked my
copy and ran it without error. Then I opened the copy they sent back to me
and ran it without error! I tried compiling both copies and they compiled
without error. So it works for me but not them--and they had successfully
run the prior version, so it doesn't seem like it would be something in their
environments. What could possibly be causing this error?
Judy Hopkins
|