Compile error in hidden module: ThisWorkbook

G

Graeme

I have a file with macros created in Excel 2003. Everything works fine on my
machine, but when I send it to a co-worker (running Excel 2000), I get the
above message. I have tested all the add-in's - they had no impact , tested
the com add-ins - there were none, searched for any pdf*.dot or pdf*.xla
files - there were none, and looked in the start up folder to remove any
suspect files, but it only contained the personal.xls file. If there are any
other suggestions, I would be very grateful to hear them. Thanks.
 
D

Dave Peterson

There are differences between what's supported in xl2003 and xl2k.

For instance, if your code does a sort, then xl2003 includes a dataoption parm
that xl2k doesn't support.

If you don't have access to a copy of xl2k, then I'd copy that workbook,
unprotect the workbook's project and send that one.

Then when the recipient opens the file in xl2k, they should go directly to the
line that causes the error. Then you'll have a hint of what to fix.

(That sort comment was just a guess. It's not the only difference between the
versions.)
 
G

Graeme

Dave,

Thank you for the response. I did as you suggested, and I had lots of
errors that were preventing the macros from running properly in xl 2000. But
I just added "On error resume next" to each of the routines, and it fixed
them all apart from one which was not too important. Thanks again.
 
D

Dave Peterson

Adding that "on error resume next" line can cause more damage than you want.

You may want to look at each error (in xl2k) and remove the part that is
specific to xl2002+).

For instance, I would still want my sort to run, so I'd just remove the
dataoption parms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top