Forum

3.02 Worksheets Not...
 
Notifications
Clear all

3.02 Worksheets Not Correctly Formatted

5 Posts
3 Users
0 Reactions
66 Views
(@stevelongton)
Posts: 2
Active Member
Topic starter
 

Why am I getting this error. If I run the exercise and don't open the 3.02 file the process works correctly, however, if I have the initial file open and use the Blank Query process =Excel.Workbook(File.Contents("C:UsersSteveOneDriveTrainingPractice Filespq_3.02.xlsx"))

I get this message 

DataSource.Error: The process cannot access the file 'C:UsersSteveOneDriveTrainingPractice Filespq_3.02.xlsx' because it is being used by another process.
Details:
C:UsersSteveOneDriveTrainingPractice Filespq_3.02.xlsx

 
Posted : 12/12/2020 2:31 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Steve,

When using the Excel.Workbook function the source file must be closed for Power Query to access it.

Mynda

 
Posted : 12/12/2020 7:07 am
(@paulma)
Posts: 17
Eminent Member
 

Hi Mynda, it would be useful if you pointed that out in the video exercise, as it appears that the file is open when you make the query. Paul

 
Posted : 13/10/2021 5:27 pm
(@paulma)
Posts: 17
Eminent Member
 

I'm confused. In the 3.02 exercise, we see the query run from an open workbook, and the data is inserted into a new sheet in the open workbook. I'm using Excel 365, and it doesn't work for me. I presume a custom query needs to be made using Excel.CurrentWorkbook() rather than Excel.Workbook(), but I can't work out the syntax. Could you offer some clarity on this? TIA. Paul

 
Posted : 14/10/2021 3:26 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Paul,

In an update to Excel you can no longer have the workbook open. You need to close the source file and get the data from a new blank workbook. I'm in the process or recording an updated course that will address this. For now there's a note under that lesson's video.

Please be sure to check under videos for important notes such as this.

Sorry for the hassle.

Mynda

 
Posted : 14/10/2021 5:31 am
Share: