Stefan,

That is not a problem. You need to change the shape of your array for 
vertical columns. If you have NumPy use the transpose function e.g. :
  sheet.Range(...) = Numeric.transpose(xarray)
Your array should look like [[1],[2],[3],...] for data in 1 column.

I also solved my problem : using Makepy results in a considerable
speed-up. If you use it, you have to take care of the fact that attributes 
become case-sensitive.

        Paul Casteels



On Fri, 18 Oct 2002, Stefan Kuzminski wrote:

> I have been trying to get around the same problem.  Horizontal ranges work
> 
> sheet.Range( "A1:J10" ).Value = [1,2,3,4,5,6,7,8,9,10]
> 
> but tring the range "A1:A10" sets all the values to 1 and the per cell
> method Cells().Value is too slow.  
> 
> 
> S
> 
> -----Original Message-----
> From: Paul Casteels [mailto:Paul.Casteels@;ua.ac.be]
> Sent: Thursday, October 17, 2002 11:49 PM
> To: [EMAIL PROTECTED]
> Subject: Excel ranges
> 
> 
> 
> I want to copy an array (size 2*8192) to an Excel range.
> This works fine :
> 
>   xlApp = Dispatch("Excel.Application")
>   xlApp.Workbooks.Add()
>   xSheet = xlApp.ActiveWorkbook.ActiveSheet
>   xSheet.Range(xSheet.Cells(row,col), \
>     xSheet.Cells(row+aLen-1,col+1)).Value = array
> 
> but is extremely slow. Is there any way to speed it up ?
> 
> Paul Casteels
> U.I.A. / Physics
> 
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython
> 

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to