Hi Team,
I'm trying to export data from SP 2013 through VBA in Excel. I found this useful thread but since it's Dead, I'd to ask the question again.
http://www.mrexcel.com/forum/excel-...export-sharepoint-2010-list-excel-2010-a.html
This is the code by the user, but I want to know few things as not aware of them:
=> LISTNAME - how to get this information
=> VIEWNAME - how to get this information
Sub TestMacro()
Dim objMyList As ListObject
Dim objWksheet As Worksheet
Dim strSPServer As String
Const SERVER As String = "http://abcd/"
Const LISTNAME As String = "{A486016E-80B2-44C3-8B4A-8394574B9430}"
Const VIEWNAME As String = ""
' The SharePoint server URL pointing to the SharePoint list to import into Excel.
strSPServer = "http://" & SERVER & "/_vti_bin"
' Add a new worksheet to the active workbook.
Set objWksheet = Worksheets.Add
' Add a list range to the newly created worksheet and populated it with the data from the SharePoint list.
Set objMyList = objWksheet.ListObjects.Add(xlSrcExternal, _ Array(strSPServer, LISTNAME, VIEWNAME),
True, , Range("a2"))
Set objMyList = Nothing
Set objWksheet = Nothing
End Sub
If I know the above two information, hopefully I should be able to run the code.
I'm trying to export data from SP 2013 through VBA in Excel. I found this useful thread but since it's Dead, I'd to ask the question again.
http://www.mrexcel.com/forum/excel-...export-sharepoint-2010-list-excel-2010-a.html
This is the code by the user, but I want to know few things as not aware of them:
=> LISTNAME - how to get this information
=> VIEWNAME - how to get this information
Sub TestMacro()
Dim objMyList As ListObject
Dim objWksheet As Worksheet
Dim strSPServer As String
Const SERVER As String = "http://abcd/"
Const LISTNAME As String = "{A486016E-80B2-44C3-8B4A-8394574B9430}"
Const VIEWNAME As String = ""
' The SharePoint server URL pointing to the SharePoint list to import into Excel.
strSPServer = "http://" & SERVER & "/_vti_bin"
' Add a new worksheet to the active workbook.
Set objWksheet = Worksheets.Add
' Add a list range to the newly created worksheet and populated it with the data from the SharePoint list.
Set objMyList = objWksheet.ListObjects.Add(xlSrcExternal, _ Array(strSPServer, LISTNAME, VIEWNAME),
True, , Range("a2"))
Set objMyList = Nothing
Set objWksheet = Nothing
End Sub
If I know the above two information, hopefully I should be able to run the code.