Automatic filter on Excel file

How can i transfer data to Excel with automatic filter? I know how to write program export to excel but i don’t know how to make it automatic filter in the excel file.

Hi Supawan, Write the code xlSheet.Range(CellNo.).AutoFilter(Field NO.,Criteria),Just before the last statement to make the excel application visible (i.e. xlApp.VIBLE := TRUE). e.g Suppose you want to set the filter to show the details of employee ‘E01’ with autofilter, that is stored in 1st field of Excel sheet. The code would be xlSheet.Range(‘A1’).AutoFilter(1,‘E01’);