First, let me say that I cannot express how helpful this library is. It has saved me a world of trouble in re-writing a number of python libraries that we have for excel in VBA, many of which use python libraries developed by others, which would be a nightmare.
I am using ExcelPython to return a python dictionary of objects that I have built. I can access the individual items in the dictionary using py.getitem and I can store them in a Variant or Object variable in VBA. I was wondering if there was a way to access the data members of those objects.
If all else fails, I can write the str function of those objects to return the data in a dictionary-like format, which I probably should do anyway if I'm being a good python developer, use Py.Str(myObject) and parse the data from there.
Thanks in advance!
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So you should be able to use Py.GetAttr(myObject, "attribute_name") to retrieve data members. FYI, to find out about the Py. functions you have at your disposal to manipulate Python objects from VBA just take a look at the source code here.
Hope this helps,
Best regards,
Eric.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All,
First, let me say that I cannot express how helpful this library is. It has saved me a world of trouble in re-writing a number of python libraries that we have for excel in VBA, many of which use python libraries developed by others, which would be a nightmare.
I am using ExcelPython to return a python dictionary of objects that I have built. I can access the individual items in the dictionary using py.getitem and I can store them in a Variant or Object variable in VBA. I was wondering if there was a way to access the data members of those objects.
If all else fails, I can write the str function of those objects to return the data in a dictionary-like format, which I probably should do anyway if I'm being a good python developer, use Py.Str(myObject) and parse the data from there.
Thanks in advance!
John
Hi John,
Thanks very much for your appreciative comments!
So you should be able to use
Py.GetAttr(myObject, "attribute_name")
to retrieve data members. FYI, to find out about thePy.
functions you have at your disposal to manipulate Python objects from VBA just take a look at the source code here.Hope this helps,
Best regards,
Eric.