Custom user control (like the old ActiveX ones)

May 18, 2011 at 7:37 PM

I want to create a custom user control that displays a gauge whose value is linked to an Excel cell.

Would it be possible to create a managed user control (with VS2010) and then use it in Excel like an ActiveX control?

For example, the calendar control can be embedded with =EMBED("MSCAL.Calendar","")

Thanks in advance for any ideas how I could achieve this?

May 19, 2011 at 5:56 AM

I think someone has tried this with only partial success.

You could create a UserControl class and register the .xll with regsvr32 MyAddin.xll. Then the embedding should create and display an instance.

What they reported is the control is displayed, but crashes and then Excel misbehaves.

My only suggestion was to have a look at the Interop Forms Toolkit 2.1:

So I think there are some painting / sizing issues with UserControls, and then I have no idea how the cell value is linked to the control.


May 19, 2011 at 7:57 AM

Thank you for the prompt and informative reply, I'm very grateful.