For controlling Excel, use pywin32, like @igowen suggests.
Note that it is possible to use static dispatch. Use makepy.py
from the pywin32 project to create a python module with the python wrappers. Using the generated wrappers simplifies development, since for instance ipython gives you tab completion and help during development.
Static dispatch example:
x:> makepy.py "Microsoft Excel 11.0 Object Library" ... Generating... Importing module x:> ipython
> from win32com.client import Dispatch
> excel = Dispatch("Excel.Application")
> wb = excel.Workbooks.Append()
> range = wb.Sheets[0].Range("A1")
> range.[Press Tab]
range.Activate range.Merge
range.AddComment range.NavigateArrow
range.AdvancedFilter range.NoteText
...
range.GetOffset range.__repr__
range.GetResize range.__setattr__
range.GetValue range.__str__
range.Get_Default range.__unicode__
range.GoalSeek range._get_good_object_
range.Group range._get_good_single_object_
range.Insert range._oleobj_
range.InsertIndent range._prop_map_get_
range.Item range._prop_map_put_
range.Justify range.coclass_clsid
range.ListNames range.__class__
> range.Value = 32
...
Documentation links:
- The O’Reilly book Python Programming on Win32 has an Integrating with Excel chapter.
- Same book, free sample chapter Advanced Python and COM covers makepy in detail.
- Tutorials
- win32com documentation, I suggest you read this first.