View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default Easy code, confounded by error

wrote:
I keep getting a "Method 'Range' of 'object _Global' failed"
error. Here is the code:
Dim temp As String
temp = Range("statusBarMsg").Value2
What can I be missing here?


With Name Manager, take a close look at how statusBarMsg is defined, if at
all. I wonder if the scope is a specific worksheet, not workbook, and when
you execute the line above, ActiveSheet is not worksheet scope defined for
statusBarMsg.

Alternatively, put the following in place of the code above and execute
(just for diagnostic purposes):

Dim nm
For Each nm In ActiveWorkbook.Names
If InStr(nm.Name, "statusBarMsg") Then MsgBox nm.Name
Next