The win32com module win32com not provide functions for directly managing an Excel spreadsheet. Rather, it provides you with a function to get an Excel spreadsheet object. From this object, you can then manipulate the spreadsheet in an object-oriented way:
import win32com.client excel = win32com.client.Dispatch("Excel.Application")
The methods and properties available for excel can be found in the Application Object documentation, which is part of the Excel Object Model Reference on MSDN.
For example, the documentation indicates that the Application object has the Workbooks property:
workbooks = excel.Workbooks
Workbooks collection has an Open method:
workbook = workbooks.Open("C:\\something.xls")
Now you can manipulate this book using the Workbook documentation !
As you can see, working with win32com is pretty closely related to the MSDN documentation. :)
Adam paynter
source share