Tuesday, 26 May 2009

Method 'post' of object 'IOWSPostData' failed

Realistically I'm talking about two different problems in this post HOWEVER I found them directly linked in my scenario so maybe you will too.

First Error: Method 'post' of object 'IOWSPostData' failed

Cause:
This is caused by a failed application add-in contained in Excel 2007;

Resolution
You need to modify an XLA file within Excel to resolve this problem - Please also remember to always backup files before modifying them.
To make this change, open the Excel Add-In EXPTOOWS.XLA located in C:\Program Files\Microsoft Office\Office12\1033 by default. (Enable Macro's as opening)

Once opened, press ALT + F11 to open the VB editor and ADD the following line:
IVer = 2

BEFORE:
Sub Initialize(List, Title, URL, QuickLaunch)
strQuickLaunch = QuickLaunch
aTarget(iPublishURL) = URL
aTarget(iPublishListName) = List
aTarget(iPublishListDesc) = Title'
lVer = Application.SharePointVersion(URL)
End Sub



AFTER:
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


Finally save the document and ignore the valid signature warning, then try again you should find it now works. (You should IVer = 3 as well if at first you don't succeed)


I at this point didn't however, we were then presented with the following error:

"The selected range cannot be converted to a list before publishing or the existing table is invalid"

Finally to fix this problem the best solution we had was to manually create the list columns from the excel worksheet into a new sharepoint list and THEN import the data into those columns this then got around the problem.

If anybody has had these problems I would be interested in hearing your accounts and resolution methods or if the above worked well.. Answers on a postcard please :).


Did I solve your problem? Buy me a virtual beer by clicking on a Google ad :). Thanks!

5 comments:

  1. I was a able to fix the problem "The Selected range cannot be converted to a list before publishing or the exisiting table is invalid" by removing the filters before importing.

    ReplyDelete
    Replies
    1. This works, Thanks

      Delete
  2. Microsoft may have attempted to fix this -- here is the subroutine from my EXPTOOWS.XLA:

    Sub Initialize(List, Title, URL, QuickLaunch)
    strQuickLaunch = QuickLaunch
    aTarget(iPublishURL) = URL
    aTarget(iPublishListName) = List
    aTarget(iPublishListDesc) = Title
    lVer = -1 ' can't tell STS server version
    If Val(Application.Version) >= 12 Then
    lVer = Application.SharePointVersion(URL)
    End If
    End Sub

    Later in code is:

    If lVer >= 2 Or lVer = -1 Then
    On Error GoTo 0
    On Error GoTo Publish_ErrHandling
    ' From now on, we use new soap method to publish list to sharepoint list . . .

    Blah, blah, blah

    Guess what? Their attempted fix doesn't work. I am still getting the IOWSPostData error.

    ReplyDelete
  3. It's a bit of an old post, but for completeness, I fixed "The Selected range cannot be converted to a list before publishing or the existing table is invalid" by selecting Format as Table first. On a similar theme, if you get HTTP 403 errors try renaming C:\Program Files\Microsoft Office\Office12\OWSSUPP.DLL.

    ReplyDelete
  4. Thanks for this tip!! It was due to the excel filters

    ReplyDelete