Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    EXCEL: 2003

    Does anyone know why within the Immediate Window, when typing the SELECTION object, the intellisense pop-up window that appears for other object like active Activecell, does not appear/pop-up?

    When I type the following:

    ?ActiveCell.

    The intellisense/pop=up shows the available objects within the ActiveCell object. But when I type the same for selection like this

    ?Selection.

    Nothing pops up. ANyone know why?


    Important Note: I do have both Excel 2003 & 2007 installed. I mention this just in case this is something known to be a problem between multiple versions of Excel.


    thanks

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    This is a complete guess, but I suspect it is because the Selection could be a cell, or a range of cells, or a picture, or a chart, etc. and each of these would have different properties and methods.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Stuart is correct - it is because the Selection can be different types of objects, so IntelliSense can't predict what properties and methods it will have when the code is run.

    Similarly, if you type

    ActiveSheet.

    IntelliSense won't kick in because the active sheet could be a worksheet or a chart sheet (or even an old-fashioned macro sheet or dialog sheet, but you hardly encounter those any more).

  4. #4
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks guys for the feedback. You confirmed what I suspected but I was hoping I was wrong. I don't have the VBA-Excel model memorised and so I rely heavy on intellisense.

    It would be nice if the intellisense,. when it ran into this kind of issue would popup still and let you select what obect ype you want and then go from there.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='edcarden' post='796451' date='05-Oct-2009 20:53']It would be nice if the intellisense,. when it ran into this kind of issue would popup still and let you select what obect ype you want and then go from there.[/quote]
    That would indeed be nice, but I fear that the probability that Microsoft will implement it (in the VBA editor at least) is negligible.

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    The best way around it is to not use Selection, but to create a variable of the appropriate type and set the selection to that variable, then you can use that variable with intellisense...

    Steve

  7. #7
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='sdckapr' post='796499' date='05-Oct-2009 21:25']The best way around it is to not use Selection, but to create a variable of the appropriate type and set the selection to that variable, then you can use that variable with intellisense...

    Steve[/quote]


    WIthin the immedaite window? Woudln;t doing that require adding/inserting a module?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='edcarden' post='796500' date='05-Oct-2009 23:38']WIthin the immedaite window? Woudln;t doing that require adding/inserting a module?[/quote]
    Yes, that would require creating a macro in a module.

    In the Immediate window, you could use

    Range("A1:C10").

    instead of Selection if the selection is a range, for example. But the Immediate window has limited functionality compared to a module.

Posting Permissions

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