[python-win32] ActiveSheets and excel

Graeme Glass graemeglass at gmail.com
Tue Sep 28 16:52:02 CEST 2004


When dispatching your own instance of excel, it is pretty straight
forward to access the workbook and ActiveSheets by way of the 
Excel.Application object, in this case exapp.
eg:

exapp = win32com.client.Dispatch("Excel.Application")
        exapp.Visible = 1
        exapp.Workbooks.Add()
        exapp.ActiveSheet.Cells(1,1).Value = 'hello'

my question is, how does one add, remove workbooks, and access
ActiveSheets from with excel by means of an Addin? I have been
attempting to access it throught what i thought was the application
interface in the plugin but it is not :-)
So i currently stand with a plugin button that can bring up message
boxes and frames but not do anything really usefull. Any help would be
very much appreciated.

Thanks, Graeme


More information about the Python-win32 mailing list