HELP!!!! -- (Method Range of _Worksheet failed) ERROR!

F

Fusion

I get this under all version of Office I have tried. Currently I am
using 2003, but I got the same message with XP and 2000. Here is my
code:

Sheets("ReportC").Range("A" & i) = "Appendix"

Basic huh. The error will occur randomly. This code worked great all
morning, then I got back from lunch and I get the error message. This
happens ALL the time. Anytime I am trying to write to a cell I may
get this error. Nothing seems to fix it, not even rebooting my pc.
Eventually it will clear itself up and I can run the code again
(exactly as it appears above).

Any ideas? Is there a better (correct) way to write values to cells.

Thanks in advance,

SOS
 
G

Guest

Sometimes if a shape or chart object is active, assigning
values to cells fails. Ensure to select worksheet cell
prior to the assignment, i.e. range("A1").select or
activecell.select
 
F

Fusion

Thanks, but thats not the problem. In fact i get a "Select" method of
range failed (Error 1004) when I tried. Could the workbook or
worksheets be locked somehow? Te are not protected and the file is
not read only, but for some reason I cant write to any cells now.

Any help?
 
H

Haldun Alay

Hi,

Did you check what value "i" has before executing that line. i variable could be empty or minus or bigger than max row count(65536).

Or some cells in Column A in the ReportC sheet could be protected...

--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.



"Fusion" <[email protected]>, iletide sunu yazdi I get this under all version of Office I have tried. Currently I am
using 2003, but I got the same message with XP and 2000. Here is my
code:

Sheets("ReportC").Range("A" & i) = "Appendix"

Basic huh. The error will occur randomly. This code worked great all
morning, then I got back from lunch and I get the error message. This
happens ALL the time. Anytime I am trying to write to a cell I may
get this error. Nothing seems to fix it, not even rebooting my pc.
Eventually it will clear itself up and I can run the code again
(exactly as it appears above).

Any ideas? Is there a better (correct) way to write values to cells.

Thanks in advance,

SOS
 
F

Fusion

Yes I checked all of that. "i" has avalue of 1, ande the cells,
worksheet and workbook are un-protected.

Help!
 

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