Version makes the difference?!
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$6553 6)\" I need to make it work on both versions...Any idea of the solution? All kinds of help will be appreciated. Thanks Frank -- uglyvb ------------------------------------------------------------------------ uglyvb's Profile: http://www.excelforum.com/member.php...o&userid=31720 View this thread: http://www.excelforum.com/showthread...hreadid=519542 |
Version makes the difference?!
Tthe workaround would be to add
ActiveSheet.UnProtect Password:="Whatever" <Your Code ActiveSheet.Protect Password:="Whatever" but someone may have a 'real' answer! |
Version makes the difference?!
Thanks jakeyC for the nice workaround, which dismisses the runtime error!...May I also refer you to http://www.excelforum.com/showthread.php?t=519532, where a proper solution has also been supplied?... Regards Frank -- uglyvb ------------------------------------------------------------------------ uglyvb's Profile: http://www.excelforum.com/member.php...o&userid=31720 View this thread: http://www.excelforum.com/showthread...hreadid=519542 |
All times are GMT +1. The time now is 01:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com