[python-win32] Re: [Tutor] Win32com/Excel

Lloyd Kvam pythontutor@venix.com
Tue, 11 Jun 2002 19:29:36 -0400


xlBook = xlApp.Workbooks.Add()
sheet = xlBook.Worksheets('Sheet1')
row1,col1,row2,col2 = 1,1,3,4	#3 rows, 4 cols
return sheet.Range(sheet.Cells(row1, col1), sheet.Cells(row2, col2)).Value

Terje Johan Abrahamsen wrote:

> I try to open Excel thru win32com. I write:
> 
>>>> from win32com.client import Dispatch
>>>> xlApp = Dispatch("Excel.Application")
>>>> xlApp.Visible = 1
>>>
> 
> I get the frame of Excel, but not the spreadsheet. Even if I write:
> 
>>>> xlApp.Workbooks.Add()
>>>
> it doesn't give me the ability to look whats there. I get the frame 
> around the spreadsheet, and the menues at the top, as well as the 
> paperclip. The paperclip works, the menus are selectable, but does not 
> work. And the space where the spreadsheet should have been gives me a 
> "picture" of what is on the desktop. (Other open windows in the 
> background and so forth). I can move the Excel frame around, and the 
> background follows along. I use the newest version of both Python and 
> Win32com, and have tried this on two computers. 1 with Win98 and 1 with 
> win2k. Same result... Anyone seen this before? And managed to solve it?
> 
> Thanks,
> Terje
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582