Power Query:在数据源文件打开时刷新 Table 查询
PowerQuery: Refreshing a Table query whilst the Data Source file is open
我有一个 excel 工作簿,其中包含一个 table,它通过 PowerQuery 链接到大量数据源文件。用户很可能会在数据源文件中更新它们。我是否可以在数据源文件被其他用户打开时使用 powerquery 刷新我的 table。我不断收到消息:
[DataSource.Error]进程无法访问文件'......',因为它正被另一个进程使用。
过滤掉名称以“~”开头的文件。
我在尝试弄清楚如何做同样的事情时发现了这个话题。以防万一以后有人发现这个问题,我会提到我是如何应用 MarcelBeug 的解决方案的。
代码是这样的
let Source = Folder.Files("MyFilePathHere\"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each
Excel.Workbook([Content],true)),
改为
let Source = Folder.Files("MyFilePathHere\"),
#"Filtered Rows1" = Table.SelectRows(Source, each not Text.StartsWith([Name], "~$")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Custom", each
Excel.Workbook([Content],true)),
我通过 GUI 编辑器对文件名使用文本过滤器进行了更改。过滤器为 'does not begin with',值为“~$”。
我有一个 excel 工作簿,其中包含一个 table,它通过 PowerQuery 链接到大量数据源文件。用户很可能会在数据源文件中更新它们。我是否可以在数据源文件被其他用户打开时使用 powerquery 刷新我的 table。我不断收到消息:
[DataSource.Error]进程无法访问文件'......',因为它正被另一个进程使用。
过滤掉名称以“~”开头的文件。
我在尝试弄清楚如何做同样的事情时发现了这个话题。以防万一以后有人发现这个问题,我会提到我是如何应用 MarcelBeug 的解决方案的。
代码是这样的
let Source = Folder.Files("MyFilePathHere\"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each
Excel.Workbook([Content],true)),
改为
let Source = Folder.Files("MyFilePathHere\"),
#"Filtered Rows1" = Table.SelectRows(Source, each not Text.StartsWith([Name], "~$")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Custom", each
Excel.Workbook([Content],true)),
我通过 GUI 编辑器对文件名使用文本过滤器进行了更改。过滤器为 'does not begin with',值为“~$”。