Problem importing xls file

Hello, I’m a beginner, I’ve created a module on dolibarr and I’m trying to import an xls file to use and manipulate the data it contains. However, the import doesn’t work and it generates an error on the argument of a foreach function in my code. Error:
Action is import… File upload to c:/dolibarr/dolibarr_documents/chacornas/tmp/ fullname=c:/dolibarr/dolibarr_documents/chacornas/tmp/import.xls Extract data from c:/dolibarr/dolibarr_documents/chacornas/tmp/import.xls Extract data from sheet number
Warning : Invalid argument supplied for foreach() in C:\dolibarr\www\dolibarr\htdocs\custom\chacornas\base_import.php on line 199
Line 199 :
foreach ($tab[$startProductsData] as $key => $val) {
if ($val != ‹ ›) {
$header[$key] = slugify($val);
}
}
The problem seems to come from the first line, according to the error displayed.
Thanks

Hello,

Do not need to put in French and English : Problème d'import de fichier xls sur mon module - #7 par ksar - Autres modules natifs - Forum Dolibarr france