View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Absolute Worksheet References

Check under tools|references for that error message (I don't recall ever seeing
this, so it's a guess.)

But this worked ok for me (xl2003):

Option Explicit
Sub testme()
Dim wks As Worksheet
Set wks = Sheet2
Debug.Print wks.Name & "--" & wks.CodeName
End Sub

And I saw this in the immediate window.

ThisIsATest--Sheet2

ric_deez wrote:

Hi Jim,

I can reference both the .Name and the .Codename properties from the
immediate window and the macros run as intended, it is just that prior
to the macros even executing I get an annoying Message Box with the
"Reference Not Valid" message. Are you using Excel 2003?

Regards,

Ric


--

Dave Peterson