VBA Macro Versions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am rather new to using Excel macros, but I have recently made an Excel
sheet with a VBA macro in Excel 2003. Some of our network users are still on
2000 or 2002 versions of Excel. Therefore they received compile errors when
they try to use the macro. Is there any way to make this VBA macro work on
their versions? Is there some sort of controls update that they can do to
make this macro work, or is this macro going to only work on Excel 2003 and
there is nothing I can do about it?

Thanks for the assistance,
ACFalcon
 
You must write your code to work on the earliest version on which
it will run.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
This does not always work as the underlying object model has changed. Is this
not your experience? (See post titled Code to different object models,
9/8/05).
 
This seems atypical. Put up some sample code that works in xl2000 and
errors in xl2002.
 
I've not experienced code that works in an earlier version but
bombs in a later version. Can you provide some examples?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
IIRC, there was one transition (don't remember the versions involved) where a
VBA function that was written without a type declaration, so defaulted to
Variant, would not compile in the newer version -- had to add the "As Variant"
to the end of the function line, i.e.

Function XXX() 'in original version

had to be changed to

Function XXX() As Variant
 

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

Back
Top