Error: “Method ‘Post’ of object ‘IOWSPostData’ failed” in SharePoint

img
When importing an Excel spreadsheet into a SharePoint List I ran into this error on a computer running Windows XP SP2 and Office 2003. Then I tried importing on a Windows Vista computer running Office 2007. After doing some research I found a solution on Microsoft MVP Kathy Hughes' blog. I am documenting the solution for Office 2007 here but the solution for Office 2003 should be similar. Just replace the references accordingly. For example, in step 2 you will replace the reference to Office 12 with Office 11. Error I experienced the error when I tried to import the spreadsheet. The error states: Method 'Post' of object 'IOWSPostData' failed excelimport61 Cause This error is apparently due to a failed Application.SharePointVersion(URL) call in the Excel add-in which causes Excel to try and use the IOWSPostData.Post() to publish the range. This method is used by SharePoint Team Services 1.0. If you can force it to use version lookup result variable (lVER) to a later version (e.g. 2 or later), Excel will use SOAP to communicate with WSS 3.0 and you should be able to import the data successfully. Solution 1. Open Excel 2007. 2. Open EXPTOOWS.XLA add-in which is located by default in C:\Program Files\Microsoft Office\Office12\1033 folder. If prompted, Enable the macros. 3. Press ALT+F11. You should see the Microsoft Visual Basic code editor window as shown below. excelimport7 If you do not see the code editor window open. Go to ExptoOWS (EXPTOOWS.XLA, Forms folder and double-click publishForm. Press F7 (or View, Code from menu) to open the code editor. 4. You need to locate the lVer = Application.SharePointVersion(URL) code. Use CTRL+F to locate the code, as shown above. The letter before "Ver" is a lowercase L, not the number 1. 5. Comment out the line that says lVer = Application.SharePointVersion(URL) as follows: 'lVer = Application.SharePointVersion(URL) 6. Add a line lVer =2. Your two lines should now read: 'lVer = Application.SharePointVersion(URL) lVer = 2 Notice the apostrophe ' before line one. 7. Save the file and exit Excel. 8. You should now be able to import Excel files into SharePoint Lists without any problems.
Copyright ©2009 Zubair Alexander. All rights reserved.