Hi,
I am attempting to create a form that for time and complexitys sake I am not using Infopath, and have got to the point where I need my excel spreadsheet to write its' form fields to a sharepoint list. I have the code below to do this:
The error I am receiving is:
Run-time Error '-2147024809 (80070057)':
Cannot connect to the server at this time. Your table cannot be published.
I have seen in other code online that people include a space character after their list name in the publish command, but I have tried it with and without and the same error occurs.
Any help with this or any other suggestions would be great!
I am attempting to create a form that for time and complexitys sake I am not using Infopath, and have got to the point where I need my excel spreadsheet to write its' form fields to a sharepoint list. I have the code below to do this:
Code:
Public Function uploadForm()
' Get the collection of lists for the active sheet
Dim L As ListObjects
Set L = Worksheets("Upload").ListObjects
' Add a new list
Dim NewList As ListObject
Worksheets("Upload").ListObjects("Form").Unlist
'Set NewList = L.Add(xlSrcRange, Range("A14,J50").CurrentRegion, , xlYes)
Set NewList = L.Add(xlSrcRange, Worksheets("Upload").Range("Upload"), xlYes)
NewList.Name = "Form"
' Publish it to my SharePoint list
NewList.Publish Array("http://teamsites.ds-s.com/sites/SDS/_layouts/viewlsts.aspx?BaseType=0", "FlagOrders "), True
End Function
The error I am receiving is:
Run-time Error '-2147024809 (80070057)':
Cannot connect to the server at this time. Your table cannot be published.
I have seen in other code online that people include a space character after their list name in the publish command, but I have tried it with and without and the same error occurs.
Any help with this or any other suggestions would be great!