excel - 在 Power Query 中参数化 SharePoint 网站上的 Excel 路径时出现无效绝对路径错误

标签 excel sharepoint powerquery dataformat

我在 SharePoint 网站上有一个有效、有效的 Excel 文件绝对路径(例如“https://.../Filename.xlsx ”),由“FilePath”表示。

我尝试通过 Power Query 从“FilePath”导入一些信息。使用

let
    Source = Excel.Workbook(Web.Contents("FilePath"), null, true),

工作正常。但是,如果我尝试通过将 "FilePath" 放置在名为 Source_Files源文件 的 Excel 表格的第一行来参数化,该表格位于我的 Power Query 所在的同一个 Excel 文件(我导入到 PowerQuery),我总是得到

DataFormat.Error: The supplied file path must be a valid absolute path.
Details:
    FilePath 

错误,我是否尝试以这种方式参数化:

let
    Source = Excel.Workbook(File.Contents(Source_Files[Source file]{0}), null, true),

或者这样:

let    
    FilePath = File.Contents(Source_Files[Source file]{0}),
    Source = Excel.Workbook(Web.Contents(FilePath), null, true),

如何在 Power Query 中参数化 SharePoint 网站上的 Excel 文件?

最佳答案

我认为替换“FilePath”的语法是:

Text.From(Excel.CurrentWorkbook(){[Name="Source_Files"]}[内容]{0}[源文件])

关于excel - 在 Power Query 中参数化 SharePoint 网站上的 Excel 路径时出现无效绝对路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36405114/

相关文章:

powerquery - 在 M 中声明数据类型的更好语法 - Text.Type 或类型文本?

excel - Function.Invoke 麻烦后

VBA 类似代码在一个工作表上完美运行,但在另一个工作表上却不行

excel - 根据列值拆分 CSV 文件的最简单方法

excel - 如何在 vba excel 中执行 Do Event 计时器,同时仍然能够更改工作表中的值?

c# - 如何将文件上传到 Sharepoint 中的文档库?

excel - 将矩阵转换为 3 列表 ('reverse pivot' 、 'unpivot' 、 'flatten' 、 'normalize' )

excel - 区域中最后使用的单元格 - Excel 2013

asp.net - 从技术上讲,Sharepoint 开发人员是否可以进行自定义应用程序开发 "equipped",反之亦然?

go - 使用用户凭据访问 Sharepoint API