Intellisense

  • Thread starter Thread starter Kramer
  • Start date Start date
K

Kramer

Hello,

This is probably a basic question, but can anyone tell me why the VBA
intellisense prompt (Excel 97) works on some objects and not on others?
For example, I get the drop-down menu after the period on this,
Range("A1:B2"), but not on these - Sheets(0), Worksheets(1). I'm sure
they used to work.

Thanks,

Dave
 
Sheets(0) could be a worksheet, a chartsheet, xlm macro sheet, ...

So there's not a good way for excel to know what to use.

I don't have a good (or any explanation) why worksheets(0) won't show the
intellisense stuff, though.

I do know that if I want the intellisense (and I usually do), I'll do:

dim wks as worksheet
set wks = worksheets(1)

wks.(and get the intellisense to pop up)
 
Bob


I meant to say sheets(1) and worksheets(1), all I want to do is
activate or select them

Dave
 
Dave,

Thanks, using the wks variable works. But just out of curiosity, does
using worksheets(1) instead of wks work for you?

Dave
 
Dave,

Thanks, using the wks variable works. But just out of curiosity, does
using worksheets(1) instead of wks work for you?

Dave
 
Bob,

I meant to say sheets(1) and worksheets(1). They're existing
worksheets that I want to select or activate.

Dave
 
No it deosn't, it doesn't work for anyone, that is why Dave defines wks.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Dave,

I know, I was just mildly ribbing the other Dave.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
You are correct, sir.

(Ed McMahon voice!)



Bob said:
No it deosn't, it doesn't work for anyone, that is why Dave defines wks.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Dave Peterson wrote...
....
I don't have a good (or any explanation) why worksheets(0) won't show the
intellisense stuff, though.
....

There's an obvious explanation: the Excel programmers screwed up. Step
into any VBA macro, and add ActiveWorkbook to the Watch Window, then
expand it. You'll see that its Worksheets property is of type Sheets
rather than of type Worksheets. This was a bug, whether it happened in
XL5 or XL97. It's been around so long I imagine Microsoft now considers
it a feature.
 
Hello,

Thanks to everyone for their replies. I'm a bit of a bit of a newby to
VBA programming (as you've probably guessed), I was obviously mistaken
in saying "it used to work". Thanks again,

Dave
 
Back
Top