Estoy intentando agrupar celdas con TOleAuto y no se como hacerlo...
Si alguien sabe si se puede y me puede decir como, estaré agradecido.
Asi es como me queda al exportar a Excel:
![Image](http://i40.tinypic.com/qsry4p.jpg)
Así es como lo quiero:
![Image](http://i43.tinypic.com/2lmqxog.jpg)
Desde ya muchas gracias.
Saludos, Esteban.
#include "Fivewin.ch"
#DEFINE xlCenter -4108
//----------------------------------//
Function Main()
Local oExcel,oWorkBook,oSheet,oRange,i,cFileName:="D:\FwhTests\MyTest"
oExcel := CREATEOBJECT( "Excel.Application" )
OEXCEL:DISPLAYALERTS=.F.
oWorkBook := oExcel:WorkBooks:Add()
oSheet := oExcel:ActiveSheet
// Main Heading
oSheet:Cells(1,1):Value:="My Heading"
// Column Headings
oSheet:Cells( 2, 1 ):Value = "Date"
oSheet:Cells( 2, 2 ):Value = "Number"
oSheet:Cells( 2, 3 ):Value = "Description"
oSheet:Cells( 2, 4 ):Value = "Amount"
// Creating Dummy Data
For i:=3 to 10
oSheet:Cells(i,1):Value=Date()
oSheet:Cells(i,2):Value=i
oSheet:Cells(i,3):Value="Description "+str(i,2)
oSheet:Cells(i,4):Value=i*10
Next
// Trying to Merge cells for the Main Heading
oRange:=oSheet:Range("A1:D1")
oRange:MergeCells:= .T.
oRange:HorizontalAlignment:= xlCenter
// Save the File
oWorkbook:SaveAs( cFileName )
oExcel:Quit()
oExcel:=NIL
Return NIL
jrestojeda wrote:Estoy intentando agrupar celdas con TOleAuto y no se como hacerlo...
Si alguien sabe si se puede y me puede decir como, estaré agradecido.
acuellar wrote:Y para dar el ancho a la columna
oSheet:Cells(i,4):NumberFormat = "$#,##0.00"
#DEFINE xlRight -4152
oSheet:Cells( 2, 4 ):Value = "Amount"
oSheet:Cells( 2, 4 ):HorizontalAlignment:=xlRight
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 36 guests