[CentralOH] Python & Win32 COM on Windows 7, Office 2010

Harris, Bryan W. Bryan.Harris at udri.udayton.edu
Wed Oct 6 16:43:07 CEST 2010

Are you trying to open an excel window or trying to read excel spreadsheets?
If you're trying to read spreadsheets:
Try xlrd and xlwt.  http://www.python-excel.org/
It works with both xls and xlsx formats.  And it's cross platform.  And it doesn't require excel to be on the system at all.  It doesn't need win32 com at all.

From: centraloh-bounces+harrisbw=notes.udayton.edu at python.org on behalf of James - Atlantix
Sent: Tue 10/5/2010 8:38 PM
To: centraloh at python.org
Subject: [CentralOH] Python & Win32 COM on Windows 7, Office 2010

I am having some real problems getting proven, existing code written in Python 2.5 to work with Excel 2010 and Windows 7. It is a bit of a nightmare.


For example, the code below works in 2003/2007 Office/Excel, but not in 2010!


import win32com.client

from win32com.client import gencache

gencache.EnsureModule('{91D6BD00-246D-11D2-8643-3AE4EC000000}', 0, 3, 7)  ß This code references the CLSID of Excel; this is for consistent opening of the app

global x1

x1 = win32com.client.Dispatch('Excel.Application') 

x1.Workbooks.Open('C:/DROPBOX/My Dropbox/LIBRARIES/Python/PADS_Project/test_excel.xls')


Right now I am trying to find the CLSID for Excel by calling Microsoft, it has only cost an hour and 4 tech support people to get where someone can go look up the number. I hope they can find it.






-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 5585 bytes
Desc: not available
URL: <http://mail.python.org/mailman/private/centraloh/attachments/20101006/4ba4713f/attachment.bin>

More information about the CentralOH mailing list