+ Reply to Thread
Results 1 to 8 of 8

Why does intellisense "disappear" at times?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-18-2010
    Location
    Las Vegas,Nevada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Why does intellisense "disappear" at times?

    I am a rare user of VBA (once a year) for the past 8 years and always have de ja newbie experience. Because I don't recall the DOM very well I rely on intellisense. At times using certain kewords/methods intellisense gives me the impression Im doing something wrong because of its lack of response.

    For example I use the Cells method because I am using dynamic single cell references.
    Cells(r,c).interior.color =255

    Intellisense will die whenever I use the cells method. Why is this?

    I've stared using a work around for this intellisense case of A.D.D.
    Range(Cells(y, x).Address).Interior.Color = 255


    or I type garbage code and clean it up

    Cells.Interior.Color=255

    This will keep intellisense offering keywords to the DOM challenged. Am I coding in an incorrect fashion to confuse VB?
    Last edited by bljoseph; 07-19-2010 at 04:31 PM. Reason: Code not tagged

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Why does intellisense "disappear" at times?

    Compile your project and fix errors, then IntelliSense will return.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-18-2010
    Location
    Las Vegas,Nevada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Why does intellisense "disappear" at times?

    No errors. Same problem. Just type any code with the Cells property for yourself. This is one I did.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    r = Target.Row
    c = Target.Column
    Cells(r, c).Interior.Color = 255
    
    End Sub



    Intellisense dies after
    Cells(r,c)
    .[No intellisense]

    Range(cells(r,c).address
    .[You have intellisense]

    How would you go about changing a cell attribute of a specific sell that you would not know until after runtime? Hardcoding is not an option. Its not a relative position from a clicked cell (i.e. target object and offset cant be used). Intellisense seems to die unless I do this.
    Last edited by bljoseph; 07-19-2010 at 01:53 AM. Reason: Code not tagged

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,982

    Re: Why does intellisense "disappear" at times?

    As is often the case, the Item property of the Range does not have a specific return type, so intellisense has no information to work with.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    07-18-2010
    Location
    Las Vegas,Nevada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Why does intellisense "disappear" at times?

    Thanks. This issue was annoying me. I thought I was coding in some esoteric way.
    Last edited by bljoseph; 07-19-2010 at 04:31 PM.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,982

    Re: Why does intellisense "disappear" at times?

    Nope!
    It's the same thing if you use ActiveSheet for example. Because it returns a generic Object type, you don't get intellisense.

  7. #7
    Registered User
    Join Date
    07-18-2010
    Location
    Las Vegas,Nevada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Why does intellisense "disappear" at times?

    Funny, Activesheet was the other example I was going to give. Generic object type, huh? Like a variant of sorts? I'll have to read up on it.

    It's funny how my annual return to VB for 2 weeks is so painful. I can get 90% of my code right but I get jacked up for a couple of days on nuances like this and selecting and activating ranges. I spend 50% of my time figuring out activate and selecting ranges which I dont ever get right every single time I do this (one week every year). I need to document thid in my personal memoirs "VBA Groundhog Day" or maybe "Deja Nu-bie".

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,982

    Re: Why does intellisense "disappear" at times?

    99.885% of the time it is unnecessary to select or activate anything in code, and it is more efficient not to if possible.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1