BrianGGG
Board Regular
- Joined
- Mar 5, 2016
- Messages
- 62
Hello. I have had the below formula in a spreadsheet for quite some time now.
The purpose of this formula is to determine the name of the Excel file that holds the formula. A table called "t_Parameters" holds the name of a subdirectory that is appended to the end of the the directory.
So, if the file is in C:\Brian\Documents and the correct t_Parameter value is "SubDir", the function will return:
C:\Brian\Documents\SubDir
The resulting directory is then retrieved by PowerQuery to determine the location of several files to read.
The problem is that now (with Excel 365 Early Adopter), when the file is in my OneDrive file structure, the CELL function returns a URL rather than a filename.
Something more like:
[TABLE="width: 763"]
<tbody>[TR]
[TD="class: xl64, width: 763"]https://xxx-my.sharepoint.com/personal/xxx/Documents/Documents/SubDir[/TD]
[/TR]
</tbody>[/TABLE]
This is definitely a problem for me because PowerQuery uses this parameter and returns an error:
The supplied Folder path must be a valid Absolute path.
So, now something that worked for several months no longer functions.
Does anyone have any idea:
thanks
BrianGGG
The purpose of this formula is to determine the name of the Excel file that holds the formula. A table called "t_Parameters" holds the name of a subdirectory that is appended to the end of the the directory.
So, if the file is in C:\Brian\Documents and the correct t_Parameter value is "SubDir", the function will return:
C:\Brian\Documents\SubDir
The resulting directory is then retrieved by PowerQuery to determine the location of several files to read.
Code:
=LEFT(@CELL("filename",D1),FIND("[",@CELL("filename",D1),1)-1)&VLOOKUP("SubDirectory",t_Parameter,2,FALSE)
The problem is that now (with Excel 365 Early Adopter), when the file is in my OneDrive file structure, the CELL function returns a URL rather than a filename.
Something more like:
[TABLE="width: 763"]
<tbody>[TR]
[TD="class: xl64, width: 763"]https://xxx-my.sharepoint.com/personal/xxx/Documents/Documents/SubDir[/TD]
[/TR]
</tbody>[/TABLE]
This is definitely a problem for me because PowerQuery uses this parameter and returns an error:
The supplied Folder path must be a valid Absolute path.
So, now something that worked for several months no longer functions.
Does anyone have any idea:
- Why the URL gets returned by CELL, and how I can stop it?
- If there's any other way to get the absolute path of the current Excel file without having to use VBA?
thanks
BrianGGG