如何使用VBA获取SharePoint中的Excel文件的属性?

我正在使用命令button创build一个macros文件,当您单击它时,它将显示属性(尤其是上载在SharePoint网站中的Excel文件的上次修改date和时间)。 我怎样才能做到这一点使用VBA。 你的反应非常快,非常感谢。 非常感谢!

我相信使vba /macros运行的唯一方法是从SharePoint 2010中打开Excel。我不认为在浏览器中打开Excel文件时,vba /macros将不会运行。

我将下面的代码添加到VBA(按F11键打开VBA编辑器):

Public Sub documentProperties() On Error Resume Next Dim oApp As New Excel.Application Dim oWB As Workbook Set oWB = ActiveWorkbook Dim propertieslist As String For l = 1 To oWB.BuiltinDocumentProperties.Count MsgBox oWB.BuiltinDocumentProperties.Item(l).Name & ":" & oWB.BuiltinDocumentProperties.Item(l).Value Next l MsgBox propertieslist End Sub 

然后,我把一个button放在Excel工作表(谷歌search“Excel 2010添加button”),以获取有关将开发者菜单添加到function区的说明。