[英]Excel .xlsx VBA ADODB connection error when opening file from sharepoint
I am trying to read a file from sharepoint location. 我正在尝试从共享点位置读取文件。 The code works absolutely fine when reading from local drive.
从本地驱动器读取时,该代码可以正常工作。 Please also note that the file type is .xlsx If I convert the file into .xls the code works fine regardless whether the file is on the server or on the local path.
另请注意,文件类型为.xlsx如果将文件转换为.xls,则无论文件在服务器上还是本地路径上,代码都可以正常工作。
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & dataPath & ";" & _
"Extended Properties=""Excel 8.0;HDR=No;"";"
External table is not in the expected format.
外部表格的格式不正确。
Connecting directly to sharepoint server to access a file creates a lot of problems. 直接连接到sharepoint服务器以访问文件会产生很多问题。
A better way of connection can be found in the following answer: 更好的连接方式可以在以下答案中找到:
Get the content of a sharepoint folder with Excel VBA 使用Excel VBA获取共享点文件夹的内容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.