Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
My usage is: I have to bundle all the pys in one exe file. And do not want that exe-file to write into it's directory. So I do: makepy -o OLE_Excel16.py and within my program: import OLE_Excel16 as Excel olx = Excel.Application() On Mon, Mar 18, 2024 at 3:25 PM Alok Bhargava wrote: >

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Many thanks Mark - it is great to be able to learn more about the system from its creators! On Mon, Mar 18, 2024 at 10:25 AM Alok Bhargava wrote: > Many thanks Harald! > > If I specify the file location when running makepy, how do I ensure > myapplication knows where to find them? Again this

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Mark Hammond
In general, if you `from win32com.client.gencache import EnsureDispatch`, you should be able to use `EnsureDispatch` anywhere you previously used plain `Dispatch`, and that code should be automatically generated and used for you. You generally only need to specify a special location or run

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Many thanks Harald! If I specify the file location when running makepy, how do I ensure myapplication knows where to find them? Again this may be a silly question, so please bear with me. Thank you! On Mon, Mar 18, 2024 at 9:36 AM wrote: > Hi Alok, > > there should be a __gencache__

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Mark Hammond
On 2024-03-18 9:12 a.m., Alok Bhargava wrote: Hi and thank you for your insightful guidance on Jannis' question.  I am running into similar issues as I work with a 3rd party COM app. This may be a silly question but could you point me to where the generated class files are located? I think

Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
Hi Alok, there should be a __gencache__ directory somewhere, which contains the generated files. But it is WAY easier to just use the -o-- Create output in a specified output file. If the path leading to the file does not exist, any missing directories will be

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Hi and thank you for your insightful guidance on Jannis' question. I am running into similar issues as I work with a 3rd party COM app. This may be a silly question but could you point me to where the generated class files are located? Many thanks! On Mon, Mar 18, 2024 at 7:43 AM wrote: >

Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
Hi Jannis, a good way forward: create less-dynamic COM-bindings by using makepy.py (it is part of your win32com-client installation, but linked here for the dokumentation) https://github.com/SublimeText/Pywin32/blob/master/lib/x32/win32com/client/makepy.py With makepy py you can create a (very

[python-win32] __getattr__ Error

2024-03-17 Thread Jannis via python-win32
Hello together, I am trying to automate a point cloud creation out of CATParts in CATIA. The win32com client can access CATIA documents, but NOT methods and attributes in the parts. I get the following error: File