A: 

Ypu can not return a generic list. this is .net specific. I have developed alot of Web services used by thrid parties and I always had to change a list to an array. Which is easy to do to be used by another language system.

myList.ToArray().

Jonathan Kaufman
Thanks Jonathan, I'll have a look at using Arrays....However in my specific problem the VBA *DOES* correctly map the C# list to a VB array of objects *EXCEPT* when the list is empty.The most obvious Horrible Hack would be to force my lists to have a meaningless zeroth element. If I do that (and I've checked that this is true) then VBA has no problem accessing the lists. But that's horrible!So - assuming I can keep my Lists, anyone got any ideas how to tell VBA to cope with an empty list?
SAL
+1  A: 

The XML deserializer code generated by the VBA Web Reference tool is very literal about the order and format of the XML it consumes (based on the WSDL it was generated from). When one of your lists in the result object is empty, the server isn't generating a container element for it, and the VBA deserializer isn't prepared to handle the missing element. Try marking both lists in the Result class (on the service side) with [XmlArray(IsNullable=true)] - this will cause an empty container element to be generated with an xsi:nil attribute when one (or both) is empty, keeping the VBA deserializer happy.

nitzmahone
Forgive the formatting if this looks odd...Can you give me an example of where to add this attribute? I triedpublic class Result{ // Lists [XmlElement(IsNullable = true)] public NoteList ErrorList = new NoteList(); [XmlElement(IsNullable = true)] public NoteList MessageList = new NoteList(); // Lots of other stuff...}but I get a Error "'System.Xml.XmlElement' is not an attribute class"???
SAL
<SLAP ON HEAD>Forgot to add "using System.Xml.Serialization"...</SLAP ON HEAD>
SAL