Link to home
Start Free TrialLog in
Avatar of alanpowell2007
alanpowell2007Flag for United States of America

asked on

Excel Vba Publish filtered data to SharePoint

I am having trying to publish filtered excel (2007) data to sharepoint. I keep getting an error that says that one table can't overlay another. Am I going about selecting the range wrong? Here is the code:

Public Sub PublishList()
' Get the collection of lists for the active sheet
Dim L As ListObjects
Set L = ActiveSheet.ListObjects
' Add a new list
Dim NewList As ListObject
Set NewList = L.Add(xlSrcRange, Range("A13:K29"), , True)
NewList.Name = "Red Team Review Metrics"
' Publish it to a SharePoint site
NewList.Publish Array("" & "_layouts/viewlsts.aspx?BaseType=0", _
"NewLists "), True
End Sub

Avatar of colly92002
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alanpowell2007


Thanks...But maybe I shoulf clarify. I don't understand why I am getting an error on this line:

Set NewList = L.Add(xlSrcRange, Range("A13:K29"), , True)

Before it even gets to the publish line. Also, my workbook is in 2010 format.

Thank you, colly92002 Though that is the easiest solution, I didn't want to have to use the add-in. But, as a side note: The add-in has vba code behind that just needs a bit of modification to work perfectly.