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

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.
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.
Contact E-mail | Terms of Use | Privacy Policy
Copyright ©2010 Zubair Alexander. All rights reserved.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
28 queries. 0.531 seconds
February 24th, 2009 at 1:21 pm
Thanks for posting this solution. I’ve been fighting this exact problem for several days, and you just solved it for me!
March 5th, 2009 at 5:56 pm
How can the solution be to open Excel 2007 when I’m using Excel 2003. I’m trying to import a file into SharePoint 2007 and when i press the import button, it just sits there, but then i close the process and it says Import Aborted. I don’t have Office 2007 available. I’m confused by your answer. Do i need to have Excel 2007 in order to do this import? And if i don’t, i’m out of luck?
Thank you in advance for your help!
Dasen
March 6th, 2009 at 8:52 am
Dasen, You don’t need Excel 2007 for importing. My solution was written for Excel 2007 but you can use Excel 2003. Just follow the same steps as for Excel 2007 but replace the references to Excel 2003 accordingly.
April 14th, 2009 at 6:54 am
I’m using Excel 2003 and have followed these steps exactly as described. However, I’m not finding the “lVer = Application.SharePointVersion(URL)” code that I’m searching for. Any ideas?
May 4th, 2009 at 6:30 pm
Cristi,
First of all make sure that you are editing the EXPTOOWS.XLA file in Office11 folder and not Office12, in case you have both versions installed. Because the line “lVer = …..” is commented out anyway, just add the “lVer = 2″ (without the quotes) at that location.
May 4th, 2009 at 7:01 pm
Hi, I am using Excel 2003. The Office12 directory does not exist on my machine. I can find this file in the Office11 directory, but it looks like the IVer = Application.SharePointVersion(URL) does not exist. I don’t know what to do. Any help is welcome.
May 4th, 2009 at 7:43 pm
Reg,
I’ve already mentioned in my article (step 2) that for Office 2003 you need to use Office11 folder. The “lVer = …..” is commented out anyway so you just need to add the “lVer = 2″ (without the quotes) line at that location in the file.
July 17th, 2009 at 4:49 pm
A wonderful article…. this is just what I needed to read today. Thanks for describing the way you work and how you structure your writing projects. I’ll go read that article now.
July 23rd, 2009 at 8:51 am
Dansen / Cristi, I’ve found the solution for Excel 2003. Instead of trying to perform the standard “create List / Import Excel” thing and getting the error that we ALL get with 2003, try this: From Excel, select the data you want to use in the Custom List, go: Data | List | Create List. This will create the list. THEN (still in excel) go back to Data | List | Publish List. This brings up a dialogue box asking for the URL of the SharePoint site. What I did was copy and paste the URL without the .aspx file (http://mysharepointsite.com/marketing/ ’cause I wanted to put the custom list in the Marketing SubSite). Give it a name and click Next. It will show you how the fields will be created (text, numbers, dates whatever..) then click Finish.
Good Luck.
November 5th, 2009 at 11:07 pm
A wonderful article…. this is just what I needed to read today. Thanks for describing the way you work and how you structure your writing projects. I’ll go read that article now.
August 23rd, 2010 at 6:20 am
Hi Alexander,
I followed your steps and changed the code in EXPTOOWS.XLA. However, after saving and trying to import again, I get a new 1004 error “application or object defined” and then the debugger stops at the following line in EXPTOOWS.XLA “rng.QueryTable.Delete ‘ delete query table if there is one on the range”
Any thoughts on this – many thanks.