Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

How to Import Excel Spreadsheets into a SharePoint List

/
/
ad-mania

Here is an example that shows in detail how you can import an Excel spreadsheet into a Microsoft Office SharePoint Server (MOSS) 2007 List. I used my Windows Networking User Group Web site as an example because I have easy access to it. I am using Excel 2007 in my example.

First create an Excel document with column headings and data that needs to be imported, if one doesn’t exist already. To import an Excel file into SharePoint, you don’t have to first create a List and all the columns because when you import an Excel spreadsheet, SharePoint will create all the columns and will also create the list based on the name you provide. If you use column names that already exist (e.g. Name), SharePoint will create a column with a number appended to it, e.g. Name1. Here are all the steps.

1. Go to Site Actions, View All Site Content.

2. Click Create.

3. In the Custom Lists section click Import Spreadsheet.

4. Enter the Name, Description and File location, where:

Name: This will be the name of the new SharePoint List
Description: An appropriate description of the SharePoint List
File location: The path to your Excel file

excelimport4

Click the Import button.

5. You will see the Excel spreadsheet open up. In the Range Type section, click the drop-down button and select Range of Cells. Click anywhere in the Select Range box. This will allow you to select the text that you want to import into SharePoint List.

excelimport5

6. Highlight the headers and all the cells with your mouse (click and drag) and then click on the icon on the right-hand side in the minimized Import to Windows SharePoint Services list. This will allow you to get back to the mode where you will be able to click the Import button.

excelimport9

7. Go ahead and click the Import button to start the import process.

excelimport10

NOTE: Whether you are using Excel 2003  or Excel 2007 there is a chance that you may see the following error:

Method ‘Post’ of object ‘IOWSPostData’ failed

excelimport61

If you get this error, don’t panic. Just read my blog post Error: “Method ‘Post’ of object ‘IOWSPostData’ failed” in SharePoint on how to work around this error.

8. If you are prompted for logon credentials, provide the account name a password that has permissions to add to the SharePoint List.

excelimport11

9. You will see your Excel spreadsheet imported into SharePoint with the name of the list that you provided in step 4.

excelimport12

NOTE:

If you used a name for the column that already exists in SharePoint, e.g. Name. SharePoint will append a number 1 to the column title, e.g. Name1. Next time it will use Name2, and so on.

Conclusion

As you can see, adding data from Excel spreadsheet into SharePoint is relatively straight forward. You should check out this blog post from my colleague Sharee English Excel and SharePoint: Part 2 because she prefers the Named Range as the Range Type and shows a slightly different method to import data from Excel into SharePoint. With Excel 2003, or even Excel 2007, you may run into the Method ‘Post’ error that I mentioned earlier. The solution I posted in another blog post seem to work for just about everyone. I’ve run into this error on several computes both Windows XP computers running Office 2003 and Windows Vista running Office 2007 and was able to fix the problem with this solution.


Copyright ©2009 Zubair Alexander. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

25 Comments

  1. Nice tutorial, but it should be mentioned that importing spreadsheets doesn’t work if you are using IE7, or a non-Microsoft Browser (from the MSDN Website)

  2. Nice tutorial. Doesn’t help me though because I want to import 3 spreadsheet files in 3 different EXISTING lists.
    Any ideas? Thanks.

  3. I tried your fix but my machine will not allow enable macros, it is disabled, then when I try and save it removes signature. I am warned when I try and open the file that the signature is invalid. I have tried opening this file on several different machines and I get the same results as mentioned above.

    Interestingly on the machine I need it to work on the exptoows.xla file is in a different location, even after I loaded office 12 on the machine. I have several problems here.

  4. Denson,
    You didn’t mention what version of Office you were using but you can try this solution from Microsoft for your invalid signature problem:
    “The “Invalid signature” indication appears when you try to open a Word document or an Excel workbook”: http://support.microsoft.com/kb/967732.

  5. Thanks for the response, I actually found what was wrong.

    It appears that the dev box wasn’t setup properly, I deleted/recreated the main Web application and added a site collection to the root. Just glad this issue was not on production. That was the problem all along. I forgot where I found the fix. Strange that this configuration would cause this problem.

    By the way I am on Office 2007. Also the exptoows.xla file was not in the 1033 of office12. Go figure.

    Again Thanks for your reply.

  6. Whenever we try to import the file we’re getting the the error “The specified file is not a valid spreadsheet or contains no data to import”. I even get this error after downloading and using the Excel Sample file.

    Do you think that this might be a configuration error?

    Appreciate your help.

    Sheila.

  7. Sheila,

    In IE, go to Tools, Internet Options, Security tab, Trusted Sites, Sites, and add your site. Hopefully that should fix the problem.

  8. Having the same problem as Sheila. My site is already a trusted site, still receiving the same problem.

  9. Thanks for the great tutorial. I should have checked this site first. I have my spreadsheet in SharePoint now in datasheet view however the formulas are not working. I have a column, for example, that tabulates the sum of several preceding columns. I can click on the cell and enter a value, but the macro does not then tabulate the sum. In SharePoint do I have to enter the updates in the Excel spreadsheet and then reload it to the SharePoint site or should the datasheet view preserve the formulas?

    Thanks.

  10. Ryan, you cannot make changes to the cell in datasheet view if you are working with a calculated column. The moment you enter a value you are essentially overwriting the calculated field. Make the change in standard view and then switch to datasheet view.

  11. Thanks for the instructions it helped. But let people know that they have to have a blank row at the top and a blank column to the left.

  12. I’m having the same problem Jeanette is. My site is already a trusted site, but I’m still getting the “not a valid spreadsheet” error.

  13. Hi sir,

    While following given steps I am getting an exception after clicking on import button-
    “An unexpected error has occurred(-2147467259)”

    Please help. What can I do?

  14. Getting error “The specified file is not a valid spreadsheet or contains no data to import”
    Please tell what to do my site is already a trusted site.

  15. I have a very large file that I’m trying to import. When I enter the cell range $A$1:$BS$2733 into the Range of Cells box I get a TYPE MISMATCH error. I’ve tried different variations of the formula to no avail. What am I doing wrong?

  16. Once you create a SharePoint list, is there a way to append it with weekly updates while keeping the previous entries? Is there a way to do this automatically? Thanks.

  17. Hello, did anyone identify a solution to the below? This is my situation too. Thanks.

    3. Neil Says:
    June 30th, 2010 at 10:02 pm
    Nice tutorial. Doesn’t help me though because I want to import 3 spreadsheet files in 3 different EXISTING lists.
    Any ideas? Thanks.

  18. Neil and Doris, check out this CodePlex solution for importing Excel data into existing SharePoint lists. This was meant for MOSS 2007 and I haven’t had a chance to try it in SP2010. Here’s the URL: http://spreadsheet2splist.codeplex.com/.

    Akaalx, I don’t know of an out-of-the-box solution but you might want to look at this Business Data List Connector for SharePoint which connects SharePoint’s native list to external business data sources. It offers bi-directional connection and updates: http://www.layer2.de/en/products/Pages/SharePoint-Business-Data-List-Connector.aspx.

  19. I keep getting error message like this. I am sure this file is not anywhere on this server. Could you please help me? “The specified name is already in use on this server. You must rename this list before publishing.” I tried renaming and it does not work still.

  20. Thanks for the nice guide. This is exactly what I was looking for.

    Keep up the good work!

    CJ

  21. Edwin, the most likely cause for the error is that you may already have the list with the same name, just like the error indicates. Go to View All Site Content and look for a list with the exact same name. If you don’t have the right permissions, you won’t see the List. If you have proper permissions but don’t see the List in your browser, try looking for the List in SharePoint Designer.

    By the way, if you upload a file that is checked out then you will also see this error. In that case go to Library/List settings and under permissions section click “Manage checked out files.” You then need to take ownership of the file.

  22. Hi guys, I am trying to import a spreadsheet into SharePoint but one error is coming on my way
    it says “The selected range cannot be converted to table before publishing or the existing table is invalid”.
    Please help me out guys.

    Thanks in advance.

  23. Benjamin, make sure you don’t have any formulas or links in the range that you have selected. You should only have data in the range.

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar