473,657 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

win32com: error 80004005

ago
I am trying to make the win32com HelloWorld server work with a VBA
client but I get:

Run-time error '-2147467259(8000 4005)':
Automation error
Unspecified error

I googled for the error but the suggested solutions (commenting out
_reg_class_spec _ and putting the server on the python path) do not seem
to make any difference (to be precise, unless I comment out
_reg_class_spec _ I cannot register the server at all) . The server
works under the python client but not on excel vba. I also tried to
debug with win32traceutil. py but I can only see the trace when using
the python client, not with excel. Any hint would be appreciated.

### PYTHON SERVER ###
class HelloClass:
_reg_desc_ = "Python Test COM Server"
_reg_clsid_ = "{91281AFC-25DF-4400-8868-FDBFCA2612A2}"
_reg_progid_ = "Python.HelloHe llo"
_public_methods _ = ['Hello']

def __init__(self): pass
def Hello(self): return "Hello"

if __name__ == "__main__":
import win32com.server .register
import sys
#sys.argv.appen d("--debug")
win32com.server .register.UseCo mmandLine(Hello Class)

### PYTHON CLIENT (WORKS) ###
import win32com.client
obj = win32com.client .Dispatch('Pyth on.HelloHello')
print obj.Hello()

### VBA CLIENT (ERROR 80004005 WHEN EXECUTING "CreateObje ct") ###
Public Sub test()
Dim obj As Object
Set obj = CreateObject("P ython.HelloHell o")
MsgBox obj.Hello("ago" )
End Sub

Mar 27 '06 #1
2 3291
ago
I solved it. If someone else is in the same situation...

It was due to a defective installation. I reinstalled python and pywin,
re-registered the server and everything worked well.

Mar 28 '06 #2
The only thing I see wrong is that the Hello method
doesn't take any arguments, but the VB code is passing one.
It works fine for me if I remove the arg.
When registered with --debug, you should still be able
to see the output in Pythonwin's trace collector window
even when the object is instantiated via VB.

hth
Roger

"ago" <xi*****@gmail. com> wrote in message news:11******** *************@j 33g2000cwa.goog legroups.com...
I am trying to make the win32com HelloWorld server work with a VBA
client but I get:

Run-time error '-2147467259(8000 4005)':
Automation error
Unspecified error

I googled for the error but the suggested solutions (commenting out
_reg_class_spec _ and putting the server on the python path) do not seem
to make any difference (to be precise, unless I comment out
_reg_class_spec _ I cannot register the server at all) . The server
works under the python client but not on excel vba. I also tried to
debug with win32traceutil. py but I can only see the trace when using
the python client, not with excel. Any hint would be appreciated.

### PYTHON SERVER ###
class HelloClass:
_reg_desc_ = "Python Test COM Server"
_reg_clsid_ = "{91281AFC-25DF-4400-8868-FDBFCA2612A2}"
_reg_progid_ = "Python.HelloHe llo"
_public_methods _ = ['Hello']

def __init__(self): pass
def Hello(self): return "Hello"

if __name__ == "__main__":
import win32com.server .register
import sys
#sys.argv.appen d("--debug")
win32com.server .register.UseCo mmandLine(Hello Class)

### PYTHON CLIENT (WORKS) ###
import win32com.client
obj = win32com.client .Dispatch('Pyth on.HelloHello')
print obj.Hello()

### VBA CLIENT (ERROR 80004005 WHEN EXECUTING "CreateObje ct") ###
Public Sub test()
Dim obj As Object
Set obj = CreateObject("P ython.HelloHell o")
MsgBox obj.Hello("ago" )
End Sub



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Mar 30 '06 #3

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

Similar topics

1
5183
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly remove old version (as well as the mx libraries I had installed). I then installed the new version as a user with the Administrator role. I know I'm technically not supposed to install to a directory with a space in the name, but it worked fine for...
0
4089
by: goermezer | last post by:
Hello, I have some problems to automate a CAD (computer aided design) Software called CATIA V5 from Dassault Systemes. CATIA V5 has a builtin VB-Editor like Word, Excel, … and registers itself as a COM-server. With VB one can automate everything in CATIA V5 with a lot of registered Object Libraries. A VB example:
5
2405
by: Christophe Cerbourg | last post by:
hi, in an ASP page, I coonect to a MSACCESS database and the first load of the page is correct but, when I immediately refresh the same page, I get an 80004005 error... Thanks for any idea... Here is the code : Set Conn = Server.CreateObject("ADODB.Connection")
15
1377
by: M P | last post by:
What does this mean? I am accessing an ASP page that queries Access Database thru fileDSN. I'm using IIS 5.0 Win2K SP4 Microsoft OLE DB Provider for ODBC Drivers error '80004005' General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x444 Thread 0xfe4 DBC 0x5200024 Jet'.
1
9146
by: g.franzkowiak | last post by:
I'm trying to use a proprietary windows software with COM and win32com. The result is everytime the error message com_error: (-2147418113, 'Catastrophic failure', None, None) I've read this in some e-mails, but can't find the solution and I have not enough experience with Windows and COM. Can anybody help ?
4
6881
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 "<interactive input>", line 1, in ?
1
3023
by: SPJ | last post by:
Sorry, forgot to mention Subject in my earlier post, hence reposting. ------------ I am writing a script which need's to convert an excel file to csv (text) format. For that I am using the following code: excel = win32com.client.Dispatch("Excel.Application","Quit") workbook = excel.Workbooks.Open(xlsfile) workbook.SaveAs(csvfile, FileFormat=24) # 24 represents xlCSVMSDOS workbook.Close(False) excel.Quit()
11
7698
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
2
10474
by: RyanN | last post by:
Greetings, I'm trying to get DispatchWithEvents() to work with HyperAccess (terminal program) without much success. I've done a bunch of searching and found some examples using IE: This works but doesn't handle the "Event Driven Functions": haObj = win32com.client.Dispatch(r"HAWin32") And so does this Internet Explorer Example:
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.