0

我正在尝试将 Sharepoint 列表导入 Excel 2010 工作表。下面的代码在 2003 年有效,但在 Excel 2010 中无效。

Set TempSheet = ThisWorkbook.Sheets.Add
TempSheet.Name = ("TEMP")
Set TempSheet2 = Sheets("TEMP")
TempSheet2.Activate    

------ the code below is the issue ----------------

Dim src(2) As Variant
src(0) = "https://REDACTED/exceptions/_vti_bin/"
src(1) = "{72B6638E-0E7B-4B37-A6A5-3142033E4E02}"
src(2) = "{163702D0-A380-467F-B883-1195F4F40616}"

TempSheet2.ListObjects.Add xlSrcExternal, src, True, xlYes, TempSheet2.Range("A2")

我收到运行时错误消息 1004。数据源初始化失败。

4

1 回答 1

0

I haven't run into this myself, but OfficeWriter has a sharepoint plugin that exports data from lists into excel workbooks. See http://www.officewriter.com/sharepoint. Disclaimer: I didn't work on this plugin, but I did work on the last version of OfficeWriter.

于 2012-06-07T15:23:52.470 回答