How To Read Excel Files In Python?

Steve Holden steve at holdenweb.com
Tue Dec 13 05:33:44 EST 2005


Anand wrote:
> Hello,
> 
> Can I get some help on how to read the excel files using python?
> 
> from win32com.client import Dispatch
> xlApp = Dispatch("Excel.Application")
> xlWb = xlApp.Workbooks.Open("Read.xls")
> xlSht = xlWb.WorkSheets(1)
> 
> But sadly, I am unable to proceed further about how to read the cells of the
> worksheet of my excel file!
> 
> Thanks for your help and cooperation.
> 
> Best regards,
> Anand
> 
> 
The best way to proceed is to record actions as macros in Excel and then 
use the recorded VBA as a guide to the Pythin required.

Unfortunately the office APIs aren't very complete in their documentation,

Good places to look, as long as you don't mind rooting around:

   http://msdn.microsoft.com/office/understanding/excel/default.aspx
 
http://msdn.microsoft.com/office/understanding/excel/documentation/default.aspx

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list