英文:
Excel Web Query: Replace query URL with value from another table
问题
目前,这个多彩的表格正在使用固定的URL。我想要发送一个用户定义的完整URL字符串到这个网络查询,并且每当它更改时都希望它更新。
这个大白色框是一个下拉列表(AN358):
用户可以选择一个新的位置:
这将显示一个新的URL(AN362),指向不同的网络表格(格式始终相同)。在我的情况下,由于它目前是一个固定链接,所以多彩的表格不会改变。
在右边,我将蓝色单元格转换为一个名为“TableYear1”的新表格(AN361):
在Power Editor中,这是现有的查询“Year 1”:
在高级编辑器中,我尝试替换这里突出显示的Web链接:
用这里下划线的值。我知道语法/用法可能是错误的...这只是为了说明我想要实现的目标。
英文:
Currently, the colorful table is using a fixed URL. I want to send a user-defined, complete URL string to this web query, and have it update whenever it's changed.
The large white box is a pulldown list (AN358):
User can choose a new location:
Which brings up a new URL (AN362) which points to a different web table (always same format). In my case, the colorful table does not change since it's currently a fixed link.
To the right, I converted the blue cells into a new table called "TableYear1" (AN361):
In power editor, here is the existing query "Year 1":
In advanced editor, I tried to replace the web link highlighted here:
With the underlined value here. I know the syntax/usage is probably wrong...it's just to illustrate what I want to accomplish.
答案1
得分: 1
尝试使用以下代码替换:
Source = Web.Page(Web.Contents(Excel.CurrentWorkbook(){[Name="TableYear1"]}[Content]{0}[URL1])),
在你的示例中,你传递了一个字符串(表名),但你需要一个对该表的引用。
英文:
try replacing the code with this
Source = Web.Page(Web.Contents(Excel.CurrentWorkbook(){[Name="TableYear1"]}[Content]{0}[URL1])),
in your example you pass a string (table name), while you need a reference to that table
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论