none
Developing an ActiveX for Excel: does that still make sense? Or is there an alternative? RRS feed

  • Question

  • Hello,

    I just finished developing a COM-visible  C# class library for use in Excel.
    I now realize that turning it into something similar to an ActiveX control would improve its usability.

    ActiveX is such an old story that I ask myself if there would not be a better solution for my need.

    In short, here is what my current class library does:

    - it exposes a few methods to be used in VBA
    - the main method retrieves a BingMaps route using the BingMaps Rest service
    - this route is split in various segments depending on the type of routes, the region, the country
    - some calculations are done on this basis, distances and tolls according to region, country, type of roads
    - these figures and can be reported in Excel with a few VBA function that communicate with the class library
    - a XAML window using a  Microsoft.Maps.MapControl.WPF can display these information using different colors
    - this window can also help visualize the details, segment by segment

    I would like to package all that into something similar to an ActiveX.
    This would allow me to drop the map-window on an Excel sheet, with many advantages, like printing with other data.

    I naively thought that an App should be the right solution today.
    Unfortunately, I guessed after a while that App s are only for web sites owner, which is meaningless for my purpose.
    I just want to create a desktop tool in Excel that makes use of the BingMaps Rest Api.

    How would you suggest me to proceed?
    And, if ActiveX would still remain the best answer, your advice would help me too.

    With my thanks and best regards,

    Michel




    • Edited by Lalbatros Monday, February 15, 2016 8:10 PM
    Monday, February 15, 2016 8:02 PM

Answers

  • Hi Michel,

    >> I first thought this was the up-to-date  way of adding controls on an Excel worksheet

    I think this is not right. Apps for Office is used to interop with Data in Excel worksheet. It is not used to add controls in excel worksheet. It host a web page in Excel, and you could add any content in web page, but you could not add any control to excel worksheet from apps for Office. Apps for Office is suitable for Office Client, Office Online and etc, but it need to host webpage in web server. So, this point “I could not see a way to do the same without any web infrastructure” is right.

    >> But there is no C# project template for an ActiveX in VS 2015, which lets me think this is maybe not the right way to go.

    Yes, there is no template for creating an ActiveX. I have shared you how to create an ActiveX control in my above link.

    >> Should I go for ActiveX while the whole world talks about "Apps for Office"?
    If you want to add control to Excel worksheet, I think you could use ActiveX control.

    >> All that is possible with Microsoft.Maps.MapControl.WPF
    If Microsoft.Maps.MapControl.WPF meets your requirement, I suggest you create an Excel add-in which use the Microsoft.Maps.MapControl.WPF control in VS. Here is a helpful link about Excel add-in.

    # How to: Add an Actions Pane to Excel Workbooks
    https://msdn.microsoft.com/library/e3zbk0hz(v=vs.100).aspx

    >> Can I conclude from your answer that I should not be shy about wrapping my class within an ActiveX?

    If you could use Microsoft.Maps.MapControl.WPF, I would suggest you use Excel add-in. If there is no control meet your requirement, I would suggest you create your own ActiveX.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, February 17, 2016 2:10 AM
  • Hi Michel,

    >> I guessed after a while that App s are only for web sites owner, which is meaningless for my purpose.

    What do you mean with “App s are only for web sites owner”?  Do you mean ActiveX control? ActiveX control is used for Excel client and it is not supported for web site. For creating an ActiveX Control, you could refer the link below:

    # Creating an ActiveX Control
    https://msdn.microsoft.com/en-us/library/aa229115%28v=vs.60%29.aspx?f=255&MSPPError=-2147217396

    >> just want to create a desktop tool in Excel that makes use of the BingMaps Rest Api

    What do you mean with “BingMaps Rest Api”? Is there any issue about your COM-Visible C# class library? Do you want to use BingMaps in Excel? If there is no special requirement, you could refer the link below for using BingMaps.

    # 4 Easy Ways to Visualize Excel Data on Bing Maps
    http://blogs.msdn.com/b/rbrundritt/archive/2014/07/16/4-easy-ways-to-visualize-excel-data-on-bing-maps.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, February 16, 2016 2:13 AM

All replies

  • Hi Michel,

    >> I guessed after a while that App s are only for web sites owner, which is meaningless for my purpose.

    What do you mean with “App s are only for web sites owner”?  Do you mean ActiveX control? ActiveX control is used for Excel client and it is not supported for web site. For creating an ActiveX Control, you could refer the link below:

    # Creating an ActiveX Control
    https://msdn.microsoft.com/en-us/library/aa229115%28v=vs.60%29.aspx?f=255&MSPPError=-2147217396

    >> just want to create a desktop tool in Excel that makes use of the BingMaps Rest Api

    What do you mean with “BingMaps Rest Api”? Is there any issue about your COM-Visible C# class library? Do you want to use BingMaps in Excel? If there is no special requirement, you could refer the link below for using BingMaps.

    # 4 Easy Ways to Visualize Excel Data on Bing Maps
    http://blogs.msdn.com/b/rbrundritt/archive/2014/07/16/4-easy-ways-to-visualize-excel-data-on-bing-maps.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, February 16, 2016 2:13 AM
  • Hello Edward,

    Thanks for your answer.

    What do you mean with “App s are only for web sites owner”? 
    I was talking about a VS project of the  the kind  Apps for Office .
    I first thought this was the up-to-date  way of adding controls on an Excel worksheet.
    But after testing and after reading, I guessed it is dedicated to web sites.
    I could not see a way to do the same without any web infrastructure.
    My application is pure desktop, with only some communication with BingMaps.
    Therefore, I thought I should recourse to the good , old and ugly ActiveX technology.
    But there is no C# project template for an ActiveX in VS 2015, which lets me think this is maybe not the right way to go. 

    What do you mean with “BingMaps Rest Api”? Is there any issue about your COM-Visible C# class library?
    I have used the
    BingMaps Rest Services  without any problem within my COM-Visible C# class library.
    I do expect problems in case I wrap my library within an ActiveX skin.
    My concern is only about choosing the right way to go.
    Should I go for ActiveX while the whole world talks about "Apps for Office"?

    Concerning the tools available for mapping in Excel, I spent a long time to look at that.
    I did not find any tool that really allows very flexible drawing on a map.
    I need to draw lines, arrows, shapes, ... . All that is possible with 
    Microsoft.Maps.MapControl.WPF .
    The mapping Apps for office and other tools that I could find do not go beyond pushing pins on the map or displaying pie charts at some places or coloring regions. This does not fit my needs. My next application will deal with waterways, again within excel, and again more specific drawing needs.

    Can I conclude from your answer that I should not be shy about wrapping my class within an ActiveX?

    Thanks for your comments.

    Michel



    • Edited by Lalbatros Tuesday, February 16, 2016 9:04 AM
    Tuesday, February 16, 2016 9:01 AM
  • Hi Michel,

    >> I first thought this was the up-to-date  way of adding controls on an Excel worksheet

    I think this is not right. Apps for Office is used to interop with Data in Excel worksheet. It is not used to add controls in excel worksheet. It host a web page in Excel, and you could add any content in web page, but you could not add any control to excel worksheet from apps for Office. Apps for Office is suitable for Office Client, Office Online and etc, but it need to host webpage in web server. So, this point “I could not see a way to do the same without any web infrastructure” is right.

    >> But there is no C# project template for an ActiveX in VS 2015, which lets me think this is maybe not the right way to go.

    Yes, there is no template for creating an ActiveX. I have shared you how to create an ActiveX control in my above link.

    >> Should I go for ActiveX while the whole world talks about "Apps for Office"?
    If you want to add control to Excel worksheet, I think you could use ActiveX control.

    >> All that is possible with Microsoft.Maps.MapControl.WPF
    If Microsoft.Maps.MapControl.WPF meets your requirement, I suggest you create an Excel add-in which use the Microsoft.Maps.MapControl.WPF control in VS. Here is a helpful link about Excel add-in.

    # How to: Add an Actions Pane to Excel Workbooks
    https://msdn.microsoft.com/library/e3zbk0hz(v=vs.100).aspx

    >> Can I conclude from your answer that I should not be shy about wrapping my class within an ActiveX?

    If you could use Microsoft.Maps.MapControl.WPF, I would suggest you use Excel add-in. If there is no control meet your requirement, I would suggest you create your own ActiveX.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, February 17, 2016 2:10 AM