ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why do I still need to cast "Range selected = (Range) app.Selection;" ??? (https://www.excelbanter.com/excel-programming/416750-why-do-i-still-need-cast-range-selected-%3D-range-app-selection%3B.html)

mattiasw

Why do I still need to cast "Range selected = (Range) app.Selection;" ???
 
I have an VBA xla that I remade to VB6-com addin 3 years ago. Now I
thought it was time to update it. I installed VS2008, latest VSTO and
the latest VSTO powertoys.

I was hoping that at last I would be able to do TYPED programming for
Excel, i.e. instead of

Range selected = (Range) app.Selection; "

I write

Range selected = app.Selection; "

Is this still a dream? Or what have I missed?

In VB6 and VBA is still better than VSTO, since in the former I can at
least se the type of the type of the object in the watch-window. In
VS2008, all I get is that it is a proxy.

Should I wait for Excel 2009 until looking into this?

-- Mattias


All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com