|
由 google云端硬碟 下载文件
我的VBA 如下:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Dim strURL As String
Dim strPath As String
Dim strFile As String
strFile = "123.xls"
strURL = "https://drive.google.com/?tab=wo&authuser=0#my-drive/" & strFile
strPath = "C:\xls\" & strFile
Ret = URLDownloadToFile(0, strURL, strPath, 0, 0)
If Ret = 0 Then
MsgBox "File successfully downloaded ok "
Else
MsgBox "Unable to download the file"
End If
执行结果 C:\xls\ 的 123.xls 是空的( 没有 工作表 )。
请教大大 要如何修正?
|
|