Skip to content

Commit c07d8d6

Browse files
authored
Create GetAbsoluteWorkbookPath.md
1 parent 20f0461 commit c07d8d6

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
This parses `cell()` output to get the **absolute filepath of the current workbook**
2+
3+
This is one way you can have powerquery autodetect absolute filepaths
4+
```
5+
= Cell( "filename" )
6+
```
7+
The raw output
8+
```
9+
c:\data\excel\[Example Sales Table.xlsx]Sheet2
10+
```
11+
formula:
12+
```sql
13+
= LET(
14+
rawName, CELL("filename"),
15+
16+
folder,
17+
TEXTBEFORE( rawName, "[", 1 ),
18+
19+
file,
20+
TEXTBEFORE(
21+
TEXTAFTER( rawName, "[", 1 ),
22+
"]", 1
23+
),
24+
25+
fullName,
26+
CONCAT(folder, file),
27+
28+
fullName )
29+
```
30+
Our final output:
31+
```
32+
c:\data\excel\Example Sales Table.xlsx
33+
```

0 commit comments

Comments
 (0)