Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Excel 1997 / 2002 Compatibility Issues

  Asked By: Armando    Date: Dec 30    Category: MS Office    Views: 547
  

I recently wrote a macro to do (amongst other things) clear the contents of a
series of cells on a worksheet in Excel 2002. However when I tried to send the
file to one of my collegues who uses the 97 version, he gets a "runtime error
1004", & the line which seems to be generating the error is as follows:


Worksheets("C.Gibbs").Range("c8:h14,j8:j14,M8:o14,u8:u14,u17:u23,m17:o23,j17:j23\
,c17:h23,c26:h32,J26:j32,m26:o32,u26:u32,U35:U41,M35:O41,J35:J41,C35:H41,C44:H50\
,J44:J50,M44:O50,U44:U50,U53:U54,M53:O54,J53:J54,C53:H54").ClearContents

Any ideas on how to solve this issue?? Sorry if this is an elementary
question!!

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Bes Massri     Answered On: Dec 30

Often there is more detail with the error number 1004 - could we have
that please?

It's very likely a compatibility  problem and the first thing I would
investigate (on an Excel97 machine) is removing the dot in the sheet
name and the code. The next thing would be to simplify the range to
say Worksheets("C.Gibbs").Range("c8:h14") and see if the code still
trips up.

ClearContents does exist in XL97 by the way.

 
Answer #2    Answered By: Naba Malik     Answered On: Dec 30



The exact error message read "Clearcontents method of range class
failed".

I've tried removing the dot from the macro & sheet name, and
simplyfying the range element but unfortunatley the same error still
persists.....

 
Answer #3    Answered By: Elizabeth Hughes     Answered On: Dec 30

try changing .clearcontents to .select and see if it still trips up.
Probably best to step through the code with F8. The implication in the
error message is that there IS a problem with ClearContents.

None of those cells is protected it it? I get error 1004 if they are,
but excel2003 reports that fact along with the error number - maybe
xl97 isn't so explanatory..

 
Answer #4    Answered By: Arlene Harvey     Answered On: Dec 30

while trying the ".select" option you
mentioned, I worked out that the reason for the error seemed to be
that there was no data for the macro to delete. This didnt seem to
cause a problem in 2002, but 97 wouldn't run it if there wasnt any
data to delete!

 
Didn't find what you were looking for? Find more on Excel 1997 / 2002 Compatibility Issues Or get search suggestion and latest updates.




Tagged: