Using an enum typecoverter in an Excel PIA DLL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?R2FsbGV5U2xhdmU=?=

    Using an enum typecoverter in an Excel PIA DLL

    I would like to use a TypeCoverter to regionalise output for enums in an
    assembly that is a PIA loaded into Excel.

    I can run this and it works on an assembly in a test project I created with
    an explicitly referenceed assembly, however when running a project that has
    been built as an Excel PIA. If I try:
    <System.Compone ntModel.TypeCon verter(GetType( ResourceEnumCon verter))_
    public enum MyEnum
    ItemA
    ItemB
    end enum

    and in code
    myE = MyEnum.ItemA
    Dim converter As System.Componen tModel.TypeConv erter =
    TypeDescriptor. GetConverter(my E)

    In the immidiate window
    ? converter.ToStr ing() goves
    "System.Compone ntModel.EnumCon verter"

    whereas in my other project (also a strongly signed assembly, but referenced
    directly from a newly created stub windows form project), I get

    ? converter.ToStr ing
    "ClassLibrary1. LocalizedEnumCo nverter"

    so it look like the LocalizedEnumCo nverter is not being bound to the enum -
    any ideas? Is this because of the way Excel loads the assembly, and is there
    a way arounfd this?
Working...