Forum

Power BI Refresh fr...
 
Notifications
Clear all

Power BI Refresh from Open Excel Workbook

12 Posts
3 Users
0 Reactions
1,423 Views
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

I’ve spent hours researching this with no luck.  If I am pulling data from a table within an Excel Workbook over to another Excel Workbook using Power BI, can I keep the source file open while refreshing?  I always receive the data source error, file used by another program.  I guess I have to close the workbook and then refresh?  I’d like to keep both open as I enter data and refresh.

 
Posted : 04/03/2020 10:45 pm
(@mynda)
Posts: 4761
Member Admin
 

No, the source workbook must be closed for Power Query to refresh, sorry.

 
Posted : 04/03/2020 10:49 pm
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

Not sure about that.  I disabled OneDrive and was able to achieve what I was asking.  I can refresh the query while the source is open.  Thus, OneDrive is the culprit (my guess with the syncing in the background).

 
Posted : 04/03/2020 11:27 pm
(@mynda)
Posts: 4761
Member Admin
 

You didn't mention OneDrive initially. If you're referencing an Excel file on your hard drive it must be closed for refreshing. As for OneDrive, I haven't tested it enough to say. Did the changes get picked up by the refresh or is it still showing the previously sync'd data?

 
Posted : 05/03/2020 2:07 am
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

Do not have to close the source file, just save it.  Once saved, the refresh picks up all changes immediately in the other file and both files remain open at the same time.

 
Posted : 05/03/2020 5:25 am
(@mynda)
Posts: 4761
Member Admin
 

Ah, that'll be because the OneDrive sync client is uploading the changes from your PC to the OneDrive file. So, why were you getting the error initially? Was the Excel file only saved on your hard drive?

 
Posted : 05/03/2020 6:18 am
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

Correct, that's what I was able to figure out.  I am pretty certain I was getting the original error because of the OneDrive sync client (i.e. the error was not be able to access the Data Source file because it was in use).  Once I "paused" OneDrive, everything worked as it should.  

 

Also, of note, there is a way to have this work and have OneDrive act as "normal."  You can achieve this by having the Query point to the URL link of the OneDrive source file (vs. having the Query point directly to the Excel Workbook).  However, if you are like me and live in an area where internet speeds are not good, the delay is too long to refresh.  Doing above, cuts down the refresh time tremendously.   

 
Posted : 06/03/2020 11:01 am
(@erik_h_dk)
Posts: 40
Trusted Member
 

Hi

I have been having the same issue using Excel Power Query and found a solution.

If you edit your query and remove queries from files beginning with "~$" ( equals open files ), then at least it works for me.

 

Erik

 
Posted : 08/01/2021 9:52 am
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

I am posting along this thread as it has to do with a refresh issue with a file not associated with OneDrive (i.e. the source data file is on the local drive but no sync with OneDrive; call this file "test.") and not working properly.  Every time I refresh the main query, the "test" file cannot be resaved to the local drive; it has a "file sharing" message.  If I close close the main query file, the source file works fine and can be saved.  It's almost as if every refresh of the query is keeping that source file from being saved, generating the "file sharing" message.  Any thoughts?  I had no luck with Erik's solution above.  Thanks.     

 
Posted : 01/02/2021 3:13 pm
(@mynda)
Posts: 4761
Member Admin
 

ExcelNovice, you haven't said what type of file 'test' is. If it's an Excel file then it must be closed for Power Query to refresh properly, so this may be the cause of your problem.

 
Posted : 01/02/2021 11:09 pm
(@novusexcel)
Posts: 67
Estimable Member
Topic starter
 

Sorry, I made the mistake of "assuming" since talking about the same power query refreshing with another open file but good point.  The source file is an Excel .xlsm file.  

 

What is odd is that I've been able to make this work before with the source file open (and, does not matter, source file is local drive or OneDrive).  For some reason, Excel is giving me the "file sharing" message within the source file while trying to save it after a refresh from the main file.  I've been able to create new "test" files and it's working but I'd like to know how to fix going forward.  I've tried all the basic stuff (indexing, sharing wizard checked, virus disabled, etc.).  

 
Posted : 02/02/2021 9:31 am
(@mynda)
Posts: 4761
Member Admin
 

Not sure, sorry. As a general rule I try to keep my source files closed when refreshing.

 
Posted : 02/02/2021 10:29 pm
Share: