Variable Sheet Name with Constant File Name

Skip2MiLu

New Member
Joined
Aug 11, 2021
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Hi Guys

Please take a look at the picture below that should describe my situation.

How do I go about adjusting my below Power Query Navigation expression that takes into account that the "Sheet Name" (i.e. Navigation expression) is variable each time the below excel report data and saved from our system, even though the "File Name" (i.e. Source expression) remains constant each time I save the excel report data.



Power Query:
let

Source = Excel.Workbook(Web.Contents("https://eznlb-my.sharepoint.com/personal/m_pinto_enzazaden_com/Documents/(Shared%20by%20Me)/Apps/(Enza%20Data%20Sources)/Cubes/[COLOR=rgb(44, 130, 201)][B]ABS%20Order%20Lines%20Batches.xlsx[/B][/COLOR]"), null, true),



#"ABS Customers_Sheet" = Source{[Item="[COLOR=rgb(184, 49, 47)][B]ExportData_MICHAELP_214[/B][/COLOR]",Kind="Sheet"]}[Data],

1676549284096.png
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I'm not sure this can help your problem, but try starting over, and when the Navigator comes up for you to select the worksheet, select the "Folder" instead:
1676551811671.png

That will leave you with a look into the entire structure of the file like this:
1676551973396.png

Hopefully you can filter out unneeded rows and then select the row with the sheet needed. If you're lucky the sheet you need might always be in the same row in which case you can just delete the other columns, and double click the Table which will make the Navigation step reference the row index {#} of the table rather than its name.

I obviously couldn't access the file in question, so it's hard to determine what's going on, but that might work for you.
 
Upvote 0

Forum statistics

Threads
1,215,745
Messages
6,126,632
Members
449,323
Latest member
Smarti1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top