使用Excel VBA将Excel文档上传到Google云端硬盘上的共享文件夹吗? [英] Upload Excel document to shared folder on Google Drive with Excel VBA?

查看:241
本文介绍了使用Excel VBA将Excel文档上传到Google云端硬盘上的共享文件夹吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了Java,C#和Access VBA的不同脚本,用于将文件上传到Google云端硬盘.但是,我在Excel VBA中唯一发现的是一个脚本,将文件保存在本地Google Drive文件夹中,然后等待应用程序对其进行同步.

I have found different scripts for Java, C#, and Access VBA for uploading a file to Google Drive. But the only thing I have found with Excel VBA, is a script saving the file in your local Google Drive folder and then wait for the application to sync it.

是否可以将Excel文件直接上传到与我共享的文件夹中?如果是,怎么办?

Is it possible to somehow upload the Excel file directly to a folder that has been shared with me? If yes, how?

推荐答案

我实际上设法做到了.

首先,您需要创建凭据.请遵循以下指南: https://updraftplus.com/support /configuring-google-drive-api-access-in-updraftplus/

First, you need to create credentials. Follow this guide: https://updraftplus.com/support/configuring-google-drive-api-access-in-updraftplus/

  • 凭据应为OAuth Client ID
  • 应用程序类型:其他

其次,我在此 https://stackoverflow.com/a/34627231/1042624 下载了此Access VBA代码.

Secondly, I downloaded this Access VBA code found here https://stackoverflow.com/a/34627231/1042624

然后,在Access文档中,将有一个设置框.您需要在此处填写有关您的帐户和步骤1中的凭据的信息.然后,您可以使用上载按钮,它将起作用. 但是,如果要在Excel中使用此功能而没有表单框,则必须单步执行代码并查找在何处使用表单框的信息.这需要相当长的时间,并且代码太长,无法在此处发布.但是现在您至少掌握了有关操作方法的信息.

Afterwards, in the Access document, there will be a settings box. You need to fill in the information about your account and the credentials from step 1 here. Then you can use the upload button, and it will work. However, if you want to use this in Excel and without the form boxes, then you have to step through the code and find where the settings form boxes´ info are being used. It takes quite a while, and the code is too long to post here. But now you at least have the information on how to do it.

注意:我仍然没有破解已启用的两步验证.

NB: I still did not crack the 2-step verification that I have enabled.

这篇关于使用Excel VBA将Excel文档上传到Google云端硬盘上的共享文件夹吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆