Version makes the difference?!

  • Thread starter Thread starter uglyvb
  • Start date Start date
U

uglyvb

Hi everyone,

I encounter a problem with running macro in Excel. Basically all works
fine with Excel 2003(tested on 2 machines) whilst a run-time error
'1004' was fired on Excel 2000( failed on 2 machines). Apparently
there's somethiing wrong with compatibility issues between these 2
vesions. The detailed message says:

run-time error '1004':
The cell or chart you are trying to change is protected and therefore
read only.

That's true and used to prevent certain cells being modified by users.
But it does run smoothly on Excel 2003 without any problem.

The piece of code causing the problem:

Range(\"K10\").Select
'Macro halts on the next line
ActiveCell.Formula =
\"=SUMIF($D$26:$D$65536,\"\"POOL\"\",$M$26:$M$65536)\"

I need to make it work on both versions...Any idea of the solution?
All
kinds of help will be appreciated.

Thanks
Frank
 
Tthe workaround would be to add

ActiveSheet.UnProtect Password:="Whatever"
<Your Code>
ActiveSheet.Protect Password:="Whatever"

but someone may have a 'real' answer!
 

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