I have a set of VBA classes in an MS Access database.
I have an xml string with data I want to create new classes with.
Other than setting each property individually, is there an easy way to deserialize the XML into my object?
I’ve seen the code using the TypeLib library
Public Sub ISerializable_Deserialize(xml As IXMLDOMNode)
Dim tTLI As TLIApplication
Dim tInvoke As InvokeKinds
Dim tName As String
Dim tMem As MemberInfo
tInvoke = VbLet
For Each tMem In TLI.ClassInfoFromObject(Me).Members
tName = LCase(tMem.Name)
CallByName Me, tMem.Name, VbLet, xml.Attributes.getNamedItem(tName).Text
Next tMem
End Sub
but this doesn’t seem to work with the standard class modules. I get a 429 error:
ActiveX Component Cannot Be Created
Can anyone else help me out? I’d rather not have to set each propery by hand if I can help it, some of these classes are huge!
You never instance
tTLIin that code & and later refer to it as justTLIso it wont work, the 429 error may be because the TypeInfo library isn’t registered, did you add it as a reference?If you did the following will work:
You can replace
InvokeHookwithCallByNameif you wish.