vba 将数据从已发布的 Google 电子表格导入 Excel

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21481725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:40:36  来源:igfitidea点击:

Import data from published Google spreadsheet to Excel

excelexcel-vbagoogle-sheetsvba

提问by Mike Eburne

I am trying to import data into an Excel spreadsheet from a published Google sheet. I have published the Google sheet and copied the URL.

我正在尝试将数据从已发布的 Google 表格导入 Excel 电子表格。我已经发布了 Google 表格并复制了 URL。

When I try and use that URL in my Excel spreadsheet, either with VB code or by standard Data Get External data From Web it asks me to log-in to Google. How can I get the data without having to log-in.

当我尝试在 Excel 电子表格中使用该 URL 时,无论是使用 VB 代码还是通过标准数据从 Web 获取外部数据,它都会要求我登录到 Google。如何在不登录的情况下获取数据。

回答by Tony

You can select in Google Sheets to publish as a CSV file

您可以在 Google 表格中选择发布为 CSV 文件

Then in excel use Data -> import FROM TEXT (not from web)

然后在 excel 中使用 Data -> import FROM TEXT (not from web)

Paste in the link to the google sheets csv file

粘贴到 google 表格 csv 文件的链接

This should read and recognise the file, you will need to configure headers, and the Comma as the separator, format etc

这应该读取并识别文件,您需要配置标题,逗号作为分隔符,格式等

Then finally one it has been imported if you go to Data -> connections you can change refresh times etc

然后最后一个它已经被导入,如果你去数据 - >连接你可以改变刷新时间等

回答by Andy Pruitt

If you are willing to use an add-in, you can have Excel and Google Sheets stay in synch.

如果您愿意使用加载项,则可以让 Excel 和 Google 表格保持同步。

Data Everywhere makes add-ins for Google Sheets and Excel that allows you to sync data between Google Sheets and Excel. You just highlight the data you want to synchronize, and both your Excel spreadsheets and your Google Sheets spreadsheets will always be in sync.

Data Everywhere 为 Google Sheets 和 Excel 制作插件,允许您在 Google Sheets 和 Excel 之间同步数据。您只需突出显示要同步的数据,您的 Excel 电子表格和 Google 表格电子表格将始终保持同步。

You can get it at Data Everywhere, or from the Google Sheets Add-in store at https://chrome.google.com/webstore/detail/data-everywhere/foenaaepondggfpfonagpmdaggmpdeel?hl=en-US

您可以在 Data Everywhere 或https://chrome.google.com/webstore/detail/data-everywhere/foenaaepondggfpfonagpmdaggmpdeel?hl=en-US的 Google 表格插件商店中获取它

Unfortunately, this add-on no longer works.

不幸的是,此附加组件不再有效。