<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Sample 10</title> </head> <body> <!-- An example that shows how to get a list of the names for each column of a workbook sheet. --> <!-- CFX_XLSReader will read an Excel file and return it as a ColdFusion query. Parameters: Action= read or getColumnNames or getSheetNames Sheets= the variable to put the list of sheet names into. SheetByIndex= the number/index of the sheet to read. HeaderRow= Yes or No (if yes, the first row of the Excel sheet will become the query column names. if they contains spaces or characters not allowed to be ColdFusion query column names they are substituted or removed.) Columns= the variable to put the column names in. The names will be the the same as the Excel column names. i.e. A,B,C,D,E,....,AA,AB,AC..... XLSFile= the Excel file to read. --> <CFX_XLSReader ACTION="getcolumnnames" sheetbyindex="1" HEADERROW="yes" columns="theColumnNames" XLSFILE="#GetDirectoryFromPath(GetBaseTemplatePath())#\read2.xls"> <!-- The sheet names are returned as a list --> <cfoutput> <ol> <cfloop index="AColumnName" list="#theColumnNames#"> <li>#AColumnName#</li> </cfloop> </ol> </cfoutput> </body> </html>