none
Getting Intelisense and Strong Typed in Excel VSTO RRS feed

  • Question

  • Hi,

    I just recently start working on VSTO. I notice that when dealing with Excel Interop object, we hardly have the intelisense and strong type functionality.

    For example:

    I don't know what type should I fill in the "HorizontalAlignment" property of the range. This is difficult for developer.

    Any advise?

    Thursday, May 17, 2012 2:30 AM

Answers

  • Hi Daniell

    There's no setting or option you can change to bring up more Intellisense than you're seeing already. I checked yesterday whether changing from var to an explicit object declaration makes a difference, and whether there was more Intellisense in a different version of Visual Studio / Office PIAs. But it's just the same.

    FWIW I, too, would have expected some kind of information upon typing =, but there's nothing. I had to go through the API Help files to find out the Excel API Enum XlAlign is expected.

    Possibly, it has something to do with HorizontalAlignment being a new property in Excel 2007. It's possible it wasn't as completely integrated (typed) in the PIAs as older commands...


    Cindy Meister, VSTO/Word MVP

    Friday, May 18, 2012 6:49 AM
    Moderator

All replies

  • Hi Daniell.Chong,

    It's based on my understanding that you will get dynamic value due to HorizontalAlignment property can't know which type of value will be set before it has been set.

    Regards,

    T.X.

    Friday, May 18, 2012 2:36 AM
  • hi, is it due to the nature of excel interop?

    can we have something like .net objects where most of the property / method are strong-type. we can see it from visual studio intellisense.

    Friday, May 18, 2012 3:22 AM
  • Hi Daniell

    There's no setting or option you can change to bring up more Intellisense than you're seeing already. I checked yesterday whether changing from var to an explicit object declaration makes a difference, and whether there was more Intellisense in a different version of Visual Studio / Office PIAs. But it's just the same.

    FWIW I, too, would have expected some kind of information upon typing =, but there's nothing. I had to go through the API Help files to find out the Excel API Enum XlAlign is expected.

    Possibly, it has something to do with HorizontalAlignment being a new property in Excel 2007. It's possible it wasn't as completely integrated (typed) in the PIAs as older commands...


    Cindy Meister, VSTO/Word MVP

    Friday, May 18, 2012 6:49 AM
    Moderator
  • Hi Cindy,

    Thanks for replying. Well, that's pretty sad if we do not have the intelisense and always need to check the API help files to find out the expected value type.

    I'll let this thread keep active for some time and hope that there're some other workarounds can be applied.

    Monday, May 21, 2012 2:56 AM