Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Loop to Load all excel Files with different headers

Hi All,

I have used below code to fetch all the excel files under single folder and its running fine but now i need to change it like 

2019 | Feb| a.xlsx|b.xlsx|c.xlsx etc

but now sheet a and c starts with header 2 and B sheet with header 3 then how to change the existing code and store it into qvd.


let vYear= Year(Today());

SUB Scanfolder(Root)

For each FileExtension in 'xlsx'

FOR Each FoundFile in FileList(Root &'\*.'& FileExtension)


// Calling Variable For current year



(ooxml, embedded labels, table is Tabelle1);

Next FoundFile

NEXT FileExtension

For Each SubDirectory in DirList (Root & '\$(vYear)\*' )

Call ScanFolder(SubDirectory)

Next SubDirectory

End Sub

Call ScanFolder('lib://SharePath(ho_a)') ;

I will be grateful for any help!

Many thanks in advance!

0 Replies