Datasheet

22
Part I: Introducing VBA
This book is written for Excel 2007 and Excel 2010, so if you don’t have one of
those versions, you run the risk of getting confused in a few places.
So what’s the point of this mini history lesson? If you plan to distribute your
Excel/VBA files to other users, it’s vitally important that you understand
which version of Excel they use. People using an older version won’t be able
to take advantage of features introduced in later versions. For example, if you
write VBA code that references cell XFD1048576 (the last cell in a workbook),
those who use a version prior to Excel 2007 will get an error because those
pre-Excel 2007 worksheets only had 65,536 rows and 255 columns (the last
cell is IV65536).
Excel 2007 and Excel 2010 also have some new objects, methods, and properties.
If you use these in your code, users with an older version of Excel will get
an error when they run your macro — and you’ll get the blame. However,
Microsoft has made available an Office Compatibility Pack, which allows
users of Excel 2003 and Excel XP to open and save workbooks in the new
file format. This product (which is free, by the way) doesn’t give these older
versions the new features. It just lets them open and save files in the Excel
2007/2010 file format.
05_503690-ch01.indd 2205_503690-ch01.indd 22 4/12/10 11:22 PM4/12/10 11:22 PM