Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Y.A. "Application-defined or object-defined error" puzzler

Status
Not open for further replies.

larryww

Programmer
Mar 6, 2002
193
US
Is anyone else fed up with this error? Today's lovely contestant is (as seen in the debug window)
?range("CurPlan")

which is a single cell which was created by Insert/Name/Define.

While the macro is not running, ?range("CurPlan") gives the correct contents.

As soon as I single-step one line into any macro, ?range("CurPlan") gives the P.O.S. error. Of course, if my code contains range("CurPlan"), Program Go Boom.

Now the awesome beauty is that I also have a range - also just one cell - called iAge, that never chokes on Range("iAge"). Why does CurPlan choke and not iAge?

Neither of the 2 cells is on the Active sheet.

Beyond explaining the error message, is this the proper way to reference a named range variable? I need the contents to do a Print #1, after some specialized formatting manipulation.

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top