473,406 Members | 2,312 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,406 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 2376

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.