Hello Rao
it is possible with the function FW_AdoToExcel determine in which sheet to export ?
Maurizio
local oExcel, oBook, oSheet
local oCn, oRs, n
oCn := FW_MSSQLDB()
oRs := FW_OpenRecordSet( oCn, "states" )
xbrowser oRs
oExcel := ExcelObj()
oBook := oExcel:WorkBooks:Open( "c:\fwh\tests\testbook.xlsx" )
oSheet := oBook:WorkSheets( "two" )
oSheet:Activate()
oSheet:Cells:Clear()
for n := 1 to oRs:Fields:Count()
oSheet:Cells( 1, n ):Value := oRs:Fields( n - 1 ):Name
next
oSheet:Cells( 2, 1 ):CopyFromRecordSet( oRs )
oRs:Close()
oCn:Close()
oExcel:Visible := .t.
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: wilsongamboa and 87 guests