How does excel application scope run background queries when xlsm file is opened?

I have a xlsm file with Background Queries running automatically when it is opened. In my current project I need to open the file, let the query run and after it finished start processing the data.

back ground query is running in excel when opened manually. But same step if we do from bot using excel application scope , it is not working.