Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Partner - Creator
Partner - Creator

How to Skip an ODBC connection scan if the excel file is opened by another user

I need to scan all the excel files' info into [LoadedTables] from a shared location (D:\SharedExcelFiles)

I have created an ODBC connection. but if anyone keeps an excel file open I am getting this error while loading.

"The Microsoft Access database engine cannot open or write to the file. It is already opened exclusively by another user, or you need permission to view and write its data."

I wanted to skip this error and scan the next excel file connection.

something like this

FOR EACH file in FileList(Path &'\*.' &'xlsx');

if ( excel file is not opened by another user / ODBC connection is fine)

then ODBC CONNECT32 TO [SOH_Excel_Files;DBQ=$(file)];


next file


Current working code to scan subfolders is >>

sub ScanFolder(Root)

FOR EACH file in FileList(Root &'\*.' &'xlsx');

//In order to get the file information from SQLtables command making use of the ODBC connection format
ODBC CONNECT32 TO [SOH_Excel_Files;DBQ=$(file)];


next file

for each SubDirectory in DirList(Root &'\*')
call ScanFolder(SubDirectory)
next SubDirectory

end sub

Call ScanFolder('D:\SharedExcelFiles');

Labels (1)
1 Reply

The list of Error Variables can be found here:

The other option might be ErrorMode:



To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.