I have a VBA excel application that essentially imports an excel list, and dependant on the column names & cell name/qty, exports a conjugated string as an XML file for import elsewhere.
I want to move to Python/Anvil to avoid the older Excel forms interface/security issues and make something Web based.
Is it possible to export, either save as or email a string as an XML file format
I don’t like XML, but I have many Excel VBA macros that convert the content of a sheet or range to JSON and call an HTTP endpoint to upload it to an Anvil app.
By adding the reference to these 2 libraries you can make HTTP requests and manage dictionaries in VBA:
You don’t really need dictionaries, because you can convert a range into a collection of collections (or array of arrays or list of lists), but it’s good to have, so you can pack the content of several ranges/sheets into one dictionary and upload all in one call.
I can’t quickly give you a working example because I have my VBA macros spread in dependencies and I would need to disentangle tons of stuff. If you need a working example, I can try to put it together during the weekend.
Just a guess, but it looks to me like you want your Anvil app to produce XML in the same format as before, so that your XML’s consumers don’t have to change.
That’s fairly easy. The Python standard library includes modules to read and write XML, and you can use these modules on the server. With the resulting string, you can do any/all of the above.
Googling the fundamentals of what is called “CRUD” and also what is called “ETL” will get you in the right frame of mind, Anvil really shines at making both of those tasks much easier than they used to be, for both us (the programmers) and the end users.
Put these concepts together with what you learn from literally one or two Anvil tutorials, and you will have a usable MVP in a few days.