1004 - Method 'Range' of object '_Worksheet' failed...

Aid2Kids

New Member
Joined
Oct 27, 2017
Messages
9
Greetings!

Excel 2010 (14.0.7190.5000) 64-bit
Win 8.1 Pro

I'm getting a 1004 error, "Method 'Range' of object '_Worksheet' failed", when I try to access a WORKBOOK-scope defined-name from a sheet's Worksheet_Activate() routine. Here's the code for the sheet...

Code:
Private Sub Worksheet_Activate()
     MsgBox "DefName contents = " & Range("TestDefName").Value
End Sub

This very code runs just fine from a code module, but not from the worksheet routine. Would someone be so kind as to give me a clue?


THANKS!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
It most likely means that:
- The named range "TestDefName" does not exist on that particular sheet
- The size of the range is more than one cell (you cannot use Range(...).Value on a multi-cell range).
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top