Using VB API with Python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Using VB API with Python
I am trying to use the VB API using Python, but I have trouble importing the IpfcAsyncConnection module.
the PRO_COMM_MSG_EXE environment variable is correctly set, and I ran "vb_api_register.bat" already.
As a result It works perfectly with the excel vb.application and vb.net.
The Python code is as follows:
import win32com.client as win32
asyncconn = win32.gencache.EnsureDispatch("pfcls.pfcAsyncConnection")
conn = asyncconn.Connect(None,None,None,None)
session = conn.Session
mdlname = session.CurrentModel.FileName;
print mdlname
but I get the following error:
File "C:\Anaconda\lib\site-packages\win32com\client\makepy.py", line 320, in
GenerateChildFromTypeLibSpec
__import__("win32com.gen_py." + dir_name + "." + child)
ImportError: No module named IpfcAsyncConnection
Anything?Anyone???
Stephane
- Labels:
-
General
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Adding a picture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Really late, but here is a small example how I did it.
from win32com.client.dynamic import Dispatch as dynDis
cAC = dynDis('pfcls.pfcAsyncConnection')
aC = cAC.Connect("", "", ".", 5)
