win32com, excel

Oliver Emrich krummbeersupp at web.de
Tue Aug 5 04:54:06 EDT 2003


Hi all,

I want to paste something from the clipboard in excel using python.

I wrote a script but there occur errors during execution.
The script looks like:

import win32com.client

xlApp = win32com.client.dynamic.Dispatch('Excel.Application')
xlBook = xlApp.Workbooks.Open("C:/test.xls")
xlSheet = xlBook.Worksheets("Test")
xlSheet.Range(sht.Cells(1, 1), sht.Cells(1, 1)).Activate()
xlSheet.Paste(1, 1)
xlBook.Save()


In VBA you just would write:
ActiveSheet.Paste

My problem is the Paste() method in Python. I think I need a Range object but I don't know how to get it.

Thanks in advance

Oliver
______________________________________________________________________________
Spam-Filter fuer alle - bester Spam-Schutz laut ComputerBild 15-03
WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/?mc=021120






More information about the Python-list mailing list