Cfspreadsheet InvocationTargetException

Hi benser,

Bad news. I tried your code and I get the same error on SpreadsheetRead. I’m able to create the xls file, but can’t read it.

Here the code. It’s better the paste the code in the forum than doing a screenshot.

<cfset data = [
    ["Name", "Age", "City"],
    ["John Doe", 30, "New York"],
    ["Jane Smith", 25, "Los Angeles"]
]>

<!--- Create a query object from the data --->
<cfset queryData = QueryNew("Name,Age,City")>
<cfloop array="#data#" index="row">
    <cfset QueryAddRow(queryData, row)>
</cfloop>

<!--- Write the query data to an Excel file in the current folder --->
<cfspreadsheet action="write" query="queryData" filename="data.xlsx" overwrite="true">

<!--- The path to the Excel file in the current folder --->
<cfset excelFilePath = "data.xlsx">

<!--- Read the Excel file --->
<cfset excelData = SpreadsheetRead(excelFilePath)>
<cfdump var="#excelData#" label="data">

When I restart Tomcat/Lucee and execute your code, I get this :

When I execute it a second time, I get the error java.lang.reflect.InvocationTargetException