DBF to Excel : Another faster way

DBF to Excel : Another faster way

Postby nageswaragunupudi » Wed Apr 26, 2023 7:05 am

Please try this:
Code: Select all  Expand view  RUN
function dbf2xlsx( cDbf )

   local oExcel   := ExcelObj()
   local oBook, cCsv, cXls

   DEFAULT cDbf   := "CUSTOMER"

   cDbf  := TrueName( cFileSetExt( cDbf, "dbf" ) )
   cCsv  := cFileSetExt( cDbf, "csv" )
   cXls  := cFileSetExt( cDbf, "xlsx" )

   FERASE( cCsv )
   FERASE( cXls )

   USE ( cDbf ) SHARED
   COPY TO ( cCsv ) DELIMITED
   oBook := oExcel:WorkBooks:Open( cCsv )
   oBook:SaveAs( cXls, 51 )
   FErase( cCsv )
   oExcel:Visible := .t.

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests