in

Corey Roth and Friends Blogs

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

Kyle Kelin on .Net

Importing data from one list to another

I needed to recreate a list on another website including the data. The list had over 150 items in it so no way was I going to recreate it manually. The first thing I did was recreate the columns for the destination list then export the original list to Excel. The option is under actions in the list view. But when I tried to import the spreadsheet into my new list I get the following error:

Import of spreadsheet error: Method 'Post' of object 'IOWSPostData' failed

I was like WTF. But a quick google search found the solution.

Open the Excel Add-In EXPTOOWS.XLA locate in C:\Program Files\Microsoft Office\Office12\1033 by default. Press Alt+F11 to display the Visual Basic code editor and search (Ctrl+F) for the line lVer = Application.SharePointVersion(URL). Comment out that line with a single quote and add the line lVer=2 so your Intialize() method should now look like this:

Sub Initialize(List, Title, URL, QuickLaunch)

strQuickLaunch = QuickLaunch

aTarget(iPublishURL) = URL

aTarget(iPublishListName) = List

aTarget(iPublishListDesc) = Title

'lVer = Application.SharePointVersion(URL)

lVer = 2

End Sub

I was a little nervous about doing this but it worked. Also when you try to save the macro it will warn you that it won't be signed if you save it. I went ahead and saved it. I haven't had any problems so far.

Comments

No Comments

Leave a Comment

(required)
(optional)
(required)
Add

About KyleKelin

Kyle Kelin has been implementing software in the Microsoft space for the past 6 years mainly as a consultant. His interests are SharePoint, .NET, JQuery, and Silverlight.
2019.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems