View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 230
Default Early binding problem

On 22/12/2011 01:48, Ron Rosenfeld wrote:
On Wed, 21 Dec 2011 12:57:42 -0500, wrote:

I believe the term for this is "context sensitive", where the VBE
implements "auto-sense" for entering valid properties/methods/constants
etcedera!


Bingo.

Do you have any idea why it sometimes works and sometimes doesn't?


Someone forgot that there are implicitly available objects like
Worksheets(), Cells() etc and AFAIK none of them intellisense.
Nor do they appear in the quick debug window when in context.

eg:

Sub foo()
Dim w As Worksheet
Set w = ThisWorkbook.Worksheets(1)

'does NOT show context sensitive prompts
Worksheets(1).Range("A1").Value = 2

'does show context sensitive prompts
w.Range("a2").Value = 3

End Sub


Regards,
Martin Brown