[RESOLVED] [VBA / VBScript] Dictionary Object with Custom Data Type-VBForums
Results 1 to 2 of 2

Thread: [RESOLVED] [VBA / VBScript] Dictionary Object with Custom Data Type

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    8

    Resolved [RESOLVED] [VBA / VBScript] Dictionary Object with Custom Data Type

    I wasn't sure whether to post this here because I'm using VBA or in VBScript because that's where the dictionary object is being imported from.

    I'm trying to use the dictionary object to be of type string, ColumnData. However, trying to add the ColumnData type to the dictionary causes the error:
    "Only user defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions."

    I originally had ColumnData defined as Private Type in a Private Class module. Based on the error I tried changing this to a PublicNotCreatable Class, however this gives an error. Finally I tried moving the Type to a module and defining it as Public, but that doesn't work either.

    Any suggestions?

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    8

    Re: [VBA / VBScript] Dictionary Object with Custom Data Type

    The basic answer is you can't. In the end I made a Class rather than a Data Type which worked out better anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.