按照标题,我试图编写仅使用vba从共享点联机文件夹中删除excel文件的代码。
由于我是VBA的新手,所以我不知道从哪里开始
答案 0 :(得分:1)
下面的代码应该可以工作。
请注意,Kill
function确实not move the file to the trash bin。小心使用!
Sub RemoveSharePointFile()
Dim folder As String, file As String, fulladdress As String
folder = "https://example.sharepoint.com/sites/test/"
file = "test.xls" 'must include extension
fulladdress = folder & file
Kill fulladdress
MsgBox "File '" & file & "' was successfully deleted.", vbInformation
End Sub
答案 1 :(得分:0)
在cmd上使用“ net use”(net use x:\ collaborate.yousite.com@SSL \ sites ...)创建一个指向共享点的本地文件夹,然后
从本地驱动程序中删除文件
杀死x:\ yourfile.pfd