How can I serialize a VBA object to a json string without knowing the object's structure?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How can I serialize a VBA object to a json string without knowing the object's structure?



I am working on synchronizing Microsoft Project tasks to an external service through REST calls from Visual Basic for Applications.



I would like to take the Task object in Microsoft Project and serialize it to JSON to be posted to a REST endpoint.



I can use this excellent library to manually build a json dictionary from the known field names:
https://github.com/VBA-tools/VBA-JSON



But this means my code is tied to the current structure of the Task object, if new fields are added in a new version, or if custom fields are added by the user, my code will need to change.



Google tells me that reflection is not supported in VBA, so maybe this is impossible, but does anyone know of a library that can take any object and serialize to JSON without compile time knowledge of its fields?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Better method to check all objects' parameters with a single call

Visual Studio Code: How to configure includePath for better IntelliSense results