Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

vchuprina
New Contributor II

How ignore empty sheet in xls files?

Last sheet in files is empty, and when I run script i receive following error message:

"Cannot locate table in BIFF file."


Part of script:

FOR j=0 TO NoOfRows('tables')-1

  LET SheetName = if(right(peek('TABLE_NAME',j,'tables'),14)='FilterDatabase',

    subfield(purgechar(purgechar(purgechar(subfield(peek('TABLE_NAME',j,'tables'),'$_',1), chr(39)),'$'),'_'), 'FilterDatabase', 1),

                    purgechar(purgechar(purgechar(peek('TABLE_NAME',j,'tables'), chr(39)),'$'),'_') );

LOAD *

.

.

.

next j;

4 Replies

Re: How ignore empty sheet in xls files?

Try setting the ErrorMode to 0 for the loop.

SET ErrorMode = 0;

// For Next loop

For ...

    .....

Next

SET ErrorMode =1;


talk is cheap, supply exceeds demand
vchuprina
New Contributor II

Re: How ignore empty sheet in xls files?

I try this, script running without error message, but data from file doesn't load

Re: How ignore empty sheet in xls files?

Works for me. See attached files.


talk is cheap, supply exceeds demand
vchuprina
New Contributor II

Re: How ignore empty sheet in xls files?

Thank you Gysbert. It works fine when sheets in source file are numerated:

Sheet1 Sheet2 .... SheetN,

but doesn't work when sheet name without number at the end.

As example names of sheets in my files:

District    Comp    Status Sheet1(empty).

Maybe you could advise me another way to disregard Sheet1

Community Browser