Excel 97 vs. Excel 2003

  • Thread starter Syed Zeeshan Haider
  • Start date
S

Syed Zeeshan Haider

Hello Experts,
A friend of mine, who is not a fond of programming, has given me a certain
task for research purposes. I have to accomplish this task in Excel with the
help of its VBA.
I have Excel 97 Pro on Win 98 while my friend has Excel 2003 Pro on WinXP
2003 Pro SP1.
I have developed some huge and complex code on my PC.
When I took this code to my friends PC, and ran it, first of all it gave me
an error on the last part of following line:

For Each cCell in [A3:A2000]

The error said "Object required".

When I replaced [A3:A2000] with Range("A3:A2000"), the code began to work.

How come a piece of code which works in Excel 97 Pro does not work in Excel
2003 Pro?
Are there any other conflicts like this one?
Where can I find them? URL etc.?

Thank you,
 
S

Syed Zeeshan Haider

in message
Syed,

I can't replicate the error in Excel 2003.

So, what should be the problem with my friend's copy of Excel 2003?

Are there any changes in VBA of Excel 2003, that should be taken care of by
the coders with Excel 97?

Thank you,
 
C

Chip Pearson

VBA took a version upgrade (v5 to v6) in Excel 2000, and remains
the same in all later releases of Excel. I don't know why your
friend's copy of Excel 2003 is causing this error.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
S

Syed Zeeshan Haider

Chip Pearson" wrote in message news:[email protected]...
VBA took a version upgrade (v5 to v6) in Excel 2000, and remains
the same in all later releases of Excel. I don't know why your
friend's copy of Excel 2003 is causing this error.

Thanks, Chip!
I'll be hopefully posting more questions after having a go-through my code
on my friend's PC.

Thanks again!
 
R

Robert McCurdy

Does this work Syed?

Dim cCell As Range
For Each cCell In [Sheet2!A3:A7].Cells
cCell.Interior.ColorIndex = Int(Rnd() * 55 + 2)
Next cCell


Regards Robert

Syed Zeeshan Haider said:
Hello Experts,
A friend of mine, who is not a fond of programming, has given me a certain
task for research purposes. I have to accomplish this task in Excel with the
help of its VBA.
I have Excel 97 Pro on Win 98 while my friend has Excel 2003 Pro on WinXP
2003 Pro SP1.
I have developed some huge and complex code on my PC.
When I took this code to my friends PC, and ran it, first of all it gave me
an error on the last part of following line:

For Each cCell in [A3:A2000]

The error said "Object required".

When I replaced [A3:A2000] with Range("A3:A2000"), the code began to work.

How come a piece of code which works in Excel 97 Pro does not work in Excel
2003 Pro?
Are there any other conflicts like this one?
Where can I find them? URL etc.?

Thank you,

<bg>
RR "The better the chilli the stinkeyer the fart - why O'Lord?
 
S

Syed Zeeshan Haider

in message
VBA took a version upgrade (v5 to v6) in Excel 2000, and remains
the same in all later releases of Excel. I don't know why your
friend's copy of Excel 2003 is causing this error.

Hi Chip,
I have figured out the problem with my friend's PC. I had a reference to an
ActiveX control in my project which was not available in my friend's PC. As
debuggers are complained about, the debugger of VBA took us to a wrong line.
This time it took us to Chr$ method.

Thank you,
 
Top