Hello,
How can I adjust the alignment of a cel, some cells, columns or rows in FWH for Excel?
Thanks.
#include "FiveWin.ch"
function Main()
local oExcel := CreateObject( "excel.application" )
local oBook := oExcel:Workbooks:Add()
local oSheet := oBook:Worksheets( 1 )
oSheet:Range( "A1" ):Value = "Last Name"
oSheet:Range( "B1" ):Value = "First Name"
oSheet:Range( "A1:B1" ):Font:Bold = .T.
oSheet:Range( "A2" ):Value = "Doe"
oSheet:Range( "B2" ):Value = "John"
oSheet:Cells(5, 1):Value := "Left Alignment"
oSheet:Cells(6, 1):Value := "Cente Alignment"
oSheet:Cells(7, 1):Value := "Right Alignment"
//&& 4 for Right Alignment, 3 for Center and 2 for Left
oSheet:Cells(5, 1):HorizontalAlignment := 4
oSheet:Cells(6, 1):HorizontalAlignment := 3
oSheet:Cells(7, 1):HorizontalAlignment := 2
oBook:SaveAs( "C:\fwh\samples\Book1.xls" )
oExcel:Visible = .T.
// oExcel:Quit()
MsgInfo( "ok" )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 103 guests