Thread: error message
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default error message

hi dave,
thanks for your input.
but did i miss someting about objects and values
please correct me if i'm wrong.

regards
FSt1

"Dave Peterson" wrote:

Check your spelling of that range name.

And check to make sure that the sheet being looked at actually has a range named
currentdb.



ranswrt wrote:

I have

dim db as string

I am trying to get the string from the cell named 'currentdb'. I have used
this same code in other procedures and it has worked fine.
"FSt1" wrote:

hi
try
set db = Range("currentdb")

you set objects and a range is an object. values are just equals(=)

regards
FSt1

"ranswrt" wrote:

I have the following code:

db = Range("currentdb")

I have used this code before in other procedures and it has worked. When I
use in a userform_Terminate I get the error

method 'Range' of Object'_Global' failed.

'currentdb' is a named cell on a worksheet.

Why won't this work?
Thanks


--

Dave Peterson