473,785 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with win32com client on windows 2003 server

SPJ
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("Exce l.Application", "Quit")
workbook = excel.Workbooks .Open(xlsfile)
workbook.SaveAs (csvfile, FileFormat=24) # 24 represents xlCSVMSDOS
workbook.Close( False)
excel.Quit()

I did not have any problem running this script on a windows xp machine with python 2.5.2 and windows extensions. But I get the following error when I run the same script on a windows 2003 server with the same python and windows extension installation:

excel = win32com.client .Dispatch("Exce l.Application", "Quit")
File "D:\Python25\Li b\site-packages\win32c om\client\__ini t__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
File "D:\Python25\li b\site-packages\win32c om\client\dynam ic.py", line 98, in _GetGoodDispatc hAndUserName
return (_GetGoodDispat ch(IDispatch, clsctx), userName)
File "D:\Python25\li b\site-packages\win32c om\client\dynam ic.py", line 78, in _GetGoodDispatc h
IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx, pythoncom.IID_I Dispatch)
com_error: (-2147221005, 'Invalid class string', None, None)

I verified that installation is same. Any idea's as to what might be the problem? One thing I have noticed though is I can't see Microsoft office 11.0 object library when I do combrowse on windows 2003 server. I also to tried to reinstall python and windows extension. But still no luck.

I would appreciate if anyone can guide me as to why this is happening and how to resolve this.

Thanks,
SPJ
_______________ _______________ _______________ _______________ _______________ _________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ
Jun 27 '08 #1
1 3038
On Apr 18, 3:12 pm, SPJ <mail2...@yahoo .comwrote:
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("Exce l.Application", "Quit")
workbook = excel.Workbooks .Open(xlsfile)
workbook.SaveAs (csvfile, FileFormat=24) # 24 represents xlCSVMSDOS
workbook.Close( False)
excel.Quit()

I did not have any problem running this script on a windows xp machine with python 2.5.2 and windows extensions. But I get the following error when I run the same script on a windows 2003 server with the same python and windows extension installation:

excel = win32com.client .Dispatch("Exce l.Application", "Quit")
File "D:\Python25\Li b\site-packages\win32c om\client\__ini t__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
File "D:\Python25\li b\site-packages\win32c om\client\dynam ic.py", line 98, in _GetGoodDispatc hAndUserName
return (_GetGoodDispat ch(IDispatch, clsctx), userName)
File "D:\Python25\li b\site-packages\win32c om\client\dynam ic.py", line 78, in _GetGoodDispatc h
IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx, pythoncom.IID_I Dispatch)
com_error: (-2147221005, 'Invalid class string', None, None)

I verified that installation is same. Any idea's as to what might be the problem? One thing I have noticed though is I can't see Microsoft office 11.0 object library when I do combrowse on windows 2003 server. I also to tried to reinstall python and windows extension. But still no luck.

I would appreciate if anyone can guide me as to why this is happening and how to resolve this.

Thanks,
SPJ

_______________ _______________ _______________ _______________ _______________ _________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ

I would recommend that you re-post to the PyWin32 user's group. They
know the low-down on this stuff.

You can find them here: http://mail.python.org/mailman/listinfo/python-win32

However, if you cannot access the object library, than that's probably
the problem. I've no idea how to resolve that though. The gurus on the
group linked above would likely know however.

Mike
Jun 27 '08 #2

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

Similar topics

3
7026
by: RJ | last post by:
Hi, I've been going over the Quick Start to Client side COM and Python and many other sources, but cannot find an example that will get my com/ActiveX .ocx USB device driver imported. The Excel and Word examples run fine. win32com.client.Dispatch("Excel.Application") etc., but how does one know the ("<foo>.<bar>") to type in? Excel looks only vaguely like "Excel.Application" in the com browser.
0
1912
by: Paul McGuire | last post by:
Software versions: Python - 2.3.3 win32all extensions - build 163 OS- Win2000 SP4 I am having trouble in accessing a customer's proprietary COM type library. After running makepy against the customer's typelib, I am still unable to create a typed object, getting the following Python traceback (I have to sanitize the customer's product, I have replaced it with XYZ):
1
3266
by: Patrick | last post by:
I am investigating a web-based app wherein I wanted to provide html form frontends to an Excel spreadsheet sitting on a MS Windows server; with each authenticated HTTP user having thier own "invisible" copy of the spreadsheet changeable via form POST via COM automation object (via Python) - then after recalculating - present the spreadsheet results in HTML. The whole idea to 1: isolate the user from having to have Excel, and 2: avoiding...
2
7099
by: Sibylle Koczian | last post by:
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But now I can't _use_ win32com as a normal user, because normal users can't write there: PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32. Portions Copyright 1994-2004 Mark Hammond (mhammond@skippinet.com.au) -
2
3300
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 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
4
6914
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 ?
2
9300
by: Ray | last post by:
Hi, I need to use cell's background color. when I record a macro from excel, it shows: Rows("7:7").Select With Selection.Interior .ColorIndex = 8 .Pattern = xlSolid
1
2749
by: Mark Morss | last post by:
Is this the place to ask a win32com.client question? I am a unix person trying to run on windows, so I have little familiarity with this module. I have this code: import win32com.client """An Access connection""" def connect(data_source, user, pwd, mdw): connAccess = win32com.client.Dispatch(r'ADODB.Connection')
11
7739
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...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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
10147
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
10083
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,...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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.