使用 VBA 检索和更新共享点列表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20704262/
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
Sharepoint list retriving and updating using VBA
提问by satish
I'm new to this, but have been reading some answers earlier and see some experts have clarified many topics which are complex and so seeking help.
我对此很陌生,但早些时候已经阅读了一些答案,并看到一些专家澄清了许多复杂的主题,因此寻求帮助。
I'm trying update sharepoint list item using VBA and not able to find a way. It appears in some thread somebody mentioned that they had been able to do. If someone has already done so, can you share the simple code to retrive a sharepoint list item and as well update the list item.
我正在尝试使用 VBA 更新共享点列表项,但找不到方法。似乎在某个线程中有人提到他们已经能够做到。如果有人已经这样做了,您能否分享简单的代码来检索共享点列表项并更新列表项。
I know how to use the list data using data connection inside Excel and there I get the complete list, but no idea how to get a particular item in the list's fields.
我知道如何使用 Excel 中的数据连接使用列表数据,并在那里获得完整列表,但不知道如何获取列表字段中的特定项目。
Would apppreciate immensely if a simple code can be shared to pull data from list to word/excel.
如果可以共享一个简单的代码来将数据从列表中提取到 word/excel,将会非常感激。
Thanks in advance Satish
提前致谢
回答by Chang Park
Microsoft has now retired their SOAP API for Sharepoint. So, it's no longer supported. Now, Microsoft has implemented REST API calls. If you're still looking for alternatives to this, try working this out. NOTE - this is only meant to retrieve values from a Sharepoint list.
Microsoft 现在已经停用了他们用于 Sharepoint 的 SOAP API。因此,它不再受支持。现在,微软已经实现了 REST API 调用。如果您仍在寻找替代方案,请尝试解决此问题。注意 - 这仅用于从 Sharepoint 列表中检索值。
Set req = CreateObject("MSXML2.XMLHTTP")
params = "owssvr.dll?Cmd=Display&ID=&XMLDATA=true&List=%7B<LISTID>%7D&View=%7B<VIEWID>%7D"
URL = "https://<SHAREPOINTSITE>/" & params
req.Open "GET", URL, False
req.Send