Posts

Showing posts with the label access Excel file

MS Excel Automation in Delphi

In this blog I will describe how to read and write data from and to an Excel file. Sometime in our application we use Excel for reporting purpose, for data import / export purpose and for other works. So here I will explain how to access an Excel file and use for data read / write. For this Excel 2003 or later should have installed in our system. First use Excel2000 unit to uses clause. This unit comes with Delphi installation it self. You can get the unit in installed path C:\Program Files (x86)\Embarcadero\RAD Studio\10.0\OCX\Servers Uses    Excel2000; Before proceed I would mention an important word  LCID which is required at most places. So what it LCID? LCID = In Microsoft Excel, the LCID indicates the currency symbol to be used when this is an xlListDataTypeCurrency type.  Returns 0 (which is the Language Neutral LCID) when no locale is set for the data type of the column. We can get LCID in Delphi by using  GetUserDefaultLCID...