Hi Tim, Thanks for replying. Apologies for my vague question, let me see if I can rephrase: I want to run pywin inside an aws instance, which only allows for command line interface.
Currently I can use pywin in my local machine, but it needs to open Visio and Word windows. However, in the aws instance it throws an error: ‘ Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 86, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vmb-cdp-sld\cdp_sld_main.py", line 1046, in <module> main() File "C:\vmb-cdp-sld\cdp_sld_main.py", line 387, in main sld_file_name = build_sld_diagram(path, opp_id, version_no, route_full) File "C:\vmb-cdp-sld\cdp_sld_main.py", line 625, in build_sld_diagram appVisio = win32com.client.gencache.EnsureDispatch('Visio.Application') File "C:\Program Files\Python37\lib\site-packages\win32com\client\gencache.py", line 618, in EnsureDispatch disp = win32com.client.Dispatch(prog_id) File "C:\Program Files\Python37\lib\site-packages\win32com\client\__init__.py", line 117, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch, userName, clsctx) File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 106, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch, None, clsctx, pythoncom.IID_IDispatch pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)’ Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? Thanks Nina On Thu, 1 Dec 2022 at 05:07 Tim Roberts <t...@probo.com> wrote: > On 11/30/22 8:16 AM, QMUL_EECS DVS wrote: > > > I hope you are well. I’m trying to use pywin32 on my local server, is > > it possible to run it without the Visio/ Word interface open? Since I > > can only see the command line > > The question doesn't make much sense. Are you saying that you want to > automate Visio and Word through pythoncom, but you don't want the > application window to be visible? That can be done. Please clarify. > > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > https://mail.python.org/mailman/listinfo/python-win32 >
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32