Excel 2003 causes error with Excel 2000 VBA code

D

darthrader

I have worsheets that used to work with Excel 2000 and now cause error
since I upgraded to Excel 2003.

I get the following error when I run the macro;

Run-time error '-2147467259 (80004005)':
Method 'Select' of object 'Shape' Failed

From the following line of code;
ActiveSheet.Shapes ("Rectangle 7") .Select

Any suggestions
 
G

Guest

I have noticed many subtle differences in working with code from 2000 and
from 2003, usually just more or less options per function. Your code here
appears correct, and it worked when I tried it. Are you sure your shapes are
named the way the code assumes they are?

Pflugs
 
D

darthrader

I believe so. The code is complicated and was written a while ago by
someone else in the company. I am trying to make it work on 2003. It
runs perfectly on Excel 2000. Does not make sense to me.

Thank you
 
G

Guest

How about the rest of the code? Can you step through it to follow what it's
doing? If so, try recording a macro doing the tasks the code is supposed to
do. Then copy and paste that into the correct spot in the code.

I have run into this exact situation myself, and sometimes this
bass-ackwards way actually solves the problem.

Pflugs
 
D

darthrader

The program is opening data files and importing the data. It is usin
the rectangle to creates buttons on the new sheet.

I am very rusty with VBA but will take time to brush up on it to ge
this to work.

I know the code is good because it works on Excel 2000. I had t
unprotect the sheets and unprotect the VBA code for this to work o
Excel 2003. I wonder if this has something to do with it.

Regards
 
D

darthrader

I believe the problem is unrelated to this line of code. If I remove i
the program stop on another line with a similar error.
Another error I get is that the range of cells on I am trying to acces
is protected. I do not get any of these errors with the same file o
Excel 2000.

Is there any special work that needs to be done to convert workbook
when going to Excel 2003
 
G

Guest

Hi Darthrader:
I have seen some other replies but maybe my experience could also help.
I have had userforms with file handling routines that worked fine in Excel
2000 go wrong in 2003, and even more weirdly they would work until I opened
them on a machine running 2003, work there and then not work anymore for
users running Excel 2000. The problem turned out to be in the references;
when opened in 2003 it reset references to the new libraries, which then were
not found by 2000.

We finally gave up and maintained two separate sets until everyone in the
Company upgraded to Office 2003.
 

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