473,225 Members | 1,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

win32com COMAdminCatalogObject Value method

rc
I'm trying to convert VB code that registers COM+ components to
Python. However, I'm unable to set values on COMAdminCatalogObject
using the Value() method, it seems to think I'm trying to call the get
method.

VB Code:
Dim cat As COMAdminCatalog
Set cat = New COMAdminCatalog
Dim apps As COMAdminCatalogCollection
Set apps = cat.GetCollection("Applications")
Dim app As COMAdminCatalogObject
Set app = apps.Add
app.Value("ID") = AppID
Python Code:
objCOMAdminCatalog =
win32com.client.Dispatch("COMAdmin.COMAdminCatalog ")
objApplications = objCOMAdminCatalog.GetCollection("Applications")
objCOMAdminCatalogObject = objApplications.Add()
print "ID", objCOMAdminCatalogObject.Value("ID") #This is returning
the random ID
# app.Value("ID") = AppID # SyntaxError: can't assign to function call
objCOMAdminCatalogObject.Value("ID", AppID) #Exception thrown

Returns the following error:
TypeError: Value() takes at most 2 arguments (3 given)

Oct 1 '07 #1
4 2367

rc wrote:
I'm trying to convert VB code that registers COM+ components to
Python. However, I'm unable to set values on COMAdminCatalogObject
using the Value() method, it seems to think I'm trying to call the get
method.

VB Code:
Dim cat As COMAdminCatalog
Set cat = New COMAdminCatalog
Dim apps As COMAdminCatalogCollection
Set apps = cat.GetCollection("Applications")
Dim app As COMAdminCatalogObject
Set app = apps.Add
app.Value("ID") = AppID
Python Code:
objCOMAdminCatalog =
win32com.client.Dispatch("COMAdmin.COMAdminCatalog ")
objApplications = objCOMAdminCatalog.GetCollection("Applications")
objCOMAdminCatalogObject = objApplications.Add()
print "ID", objCOMAdminCatalogObject.Value("ID") #This is returning
the random ID
# app.Value("ID") = AppID # SyntaxError: can't assign to function call
objCOMAdminCatalogObject.Value("ID", AppID) #Exception thrown

Returns the following error:
TypeError: Value() takes at most 2 arguments (3 given)
Try objCOMAdminCatalogObject.SetValue("ID", AppID).

Roger
Oct 1 '07 #2
rc
Try objCOMAdminCatalogObject.SetValue("ID", AppID).
>
Roger- Hide quoted text -

- Show quoted text -
When I try that I get exception:
AttributeError: Add.SetValue

I think the only valid methods are: Key(), Name(), Valid() and Value()

The thing I'm most confused about is that it seems to be getting into
the __getattr__ method, not the set, here's the whole error:
Traceback (most recent call last):
File "C:\programming\python\dev\src\FullInstallScri pts
\COMObjectFullInstall.py", line 74, in <module>
CreateApplication()
File "C:\programming\python\dev\src\FullInstallScri pts
\COMObjectFullInstall.py", line 21, in CreateApplication
objCOMAdminCatalogObject.SetValue("ID", AppID)
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 496, in __getattr__
raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: Add.SetValue

Oct 2 '07 #3
En Tue, 02 Oct 2007 12:12:09 -0300, rc <ch*******@gmail.comescribi�:
>Try objCOMAdminCatalogObject.SetValue("ID", AppID).
When I try that I get exception:
AttributeError: Add.SetValue
I think you would get more help asking in py**********@python.org

--
Gabriel Genellina

Oct 3 '07 #4
rc
On Oct 2, 11:11 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Tue, 02 Oct 2007 12:12:09 -0300, rc <chlo.p...@gmail.comescribi?:
Try objCOMAdminCatalogObject.SetValue("ID", AppID).
When I try that I get exception:
AttributeError: Add.SetValue

I think you would get more help asking in python-wi...@python.org

--
Gabriel Genellina
Thank you, python-win32 was able to help.
makepy needed to be run on the COM object allowing SetValue to be
called:
win32com.client.gencache.EnsureModule(pywintypes.I ID('{F618C513-
DFB8-11D1-A2CF-00805FC79235}'), 0x0, 1, 0)

Oct 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: T.T.H. | last post by:
Hi I am coding a C++ COM object which I want to access in Python. For that I do have some detail questions and need help since I am not that familiar with the documentation itself of Python and...
0
by: mb3242 | last post by:
Hello, I'm trying to use win32com to call a method in a COM object. I'm having a problem with Python choosing the wrong type when wrapping up lists into VARIANTs. The function I'm trying to call...
0
by: kenchanningphd | last post by:
Can someone post or point me to a fairly simple example where a COM interface (other than the standard ones already exposed by the win32com library) is implemented in python. I fear I am doing it...
5
by: Chris | last post by:
Hi, I'm trying to figure out how to submit javascript forms using win32com in order to complete repetitive processes. The Webpage Source: (I tried to include only the important stuff)...
1
by: koia | last post by:
Hi, I have a problem with adding attributes to a Line in an Excel drawing using the Python win32com interface. From recording in Excel I get the Macro: Sub Makro1()...
2
by: ago | last post by:
I am trying to make the win32com HelloWorld server work with a VBA client but I get: Run-time error '-2147467259(80004005)': Automation error Unspecified error I googled for the error but...
2
by: cfriedalek | last post by:
I'm driving Excel from python, largely successfully. Now I'm trying to add errorbars to XY scatter plots. Keep getting a com_error. Can't track down the problem. I modified a simple example to...
1
by: Ransom | last post by:
Hey folks... Newbie here. I'm working with win32com launching, closing and re-launching Excel grabbing output and doing stuff. Well, on some occasions, I get the following error: ...
4
by: mirandacascade | last post by:
O/S : Win2K vsn of Python: 2.4 Hoping to find information that provide information about error messages being encountered. Pythonwin session: Traceback (most recent call last): File...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.