.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Import excel to sharepoint list

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#
Could any one post me a sample code in c# to import data from an excel to a new sharepoint list

View Complete Post

More Related Resource Links

Import Excel spreadsheet To Sharepoint List

Hi, I am having sharepoint 2010 RTM trial on Windows Server 2008 SP2. I want to populate csv filke data to new sharepoint list. I am using custom List Wizard to achieve this... When I Import csv on server then everything is fine but when i inport csv from client, i get the following error "The Specified is not valid Spreadsheet or contains no data to import" I have also checked to import excel workbook but it gives the same error on client and do great on server..... can anybody have any idea what is wrong ?? thanks

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Exporting SharePoint list to excel.

Hi All,   We have a SharePoint list in which one column is "Person or Group" and it can take multiple values. When we export it to spread sheet this column contains some junk data.We are using MOSS 2007 and Office 2007. Previously asked question on the same issue http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/00cc338d-8201-4b8d-b2ea-5979ee58a464 Does any one know of a Microsoft published article for this issue as we need to provide it to our higher ups for this issue.   Thanks.

Excel External Table Data can only create new SharePoint List when Exporting from Excel?

I have a SQL Query that I refresh everyday in Excel. I want to be able to export this list over to a SharePoint list right after my refresh in Excel but I can only Export to a SharePoint list only once. If I try to export again to the same list then it will give me the error "The specified list name is already in use on this server. You must rename the list before publishing it to the server." I have web parts that have connections to this list and I do not want to export my Query to a new SharePoint list everyday. Does anyone know a way around this issue?

Pulling data from an Excel Speadsheet to a Sharepoint List

I have an Excel Spreadsheet filled with company phone numbers which I would like to pull into a Sharepoint List. I am unsure of how to go about this, as my only experience so far is using SQL statements for an Access Database to pull information from one location to another. I would also like this list to be searchable and sortable if possible. As another option, I have looked at Datasheet views in Sharepoint and it is possible that the data could be re-entered in here (will take a very long time though) but I unfortunetly also don't know how to export the data into a printable document from here. Any help with either option would be very much appreciated as I am quite new to Sharepoint! Thank you very much

SharePoint 2010 Export list Items to Excel, wrong url in iqy file

Hi, I have a SharePoint 2010 Environment that uses https://portal.<something>.com. Exporting to Excel of a list uses wrong URL. When I go to the a list, select the list to show the "office ribbon" and then select export to excel, excel will show the error "Excel cannot connect to the SharePoint List". When I take a look at the IQY file that is created it contains the wrong url: http://portal.<something>.com instead of https://portal.<something>.com Changing the URL in the IQY file manualy to https://portal.<something>.com and then opening it will excel is working fine, list data is exported to excel then. Alternate access mapping is configured to use https://portal.<something>.com as default, export to access is working normaly. I already deleted the http://portal.<something>.com alternate access mapping once to see if this fixes the problem. No fix, even not after IISreset or rebooting the server. Where or how is the export to Excel IQY file created and where is it possible to fix the URL it is putting in the IQY file? Grtz, Arjan

How to import two excel files into one list?

I know that I can export Excel data into new list in MOSS 2010 via Excel 2010. But when I was trying to add data into existing list, it was impossible. I know one way - copy data in Excel and paste it into the list in DataSheet View. Is there another way?

import data from infopath xml forms to SharePoint list

Hi. I have this issue, a customer has an old application that consists of a SharePoint 2003 site and a 'forms library' with forms listing information about physical servers. The infopath (2003) form is pretty straight forward and has a few dropdowns from lists and so on. Now, we need to move this to 2010 and preferably to a list only using oob functionality. I would like to know if anyone has a clue as to how I can get the data from the hundreds of xml files into a list, could be to excel and then to SharePoint, or any means Necessary. I would prefer it if it can be scripted or done using standard tools from Microsoft, no 3rd party custom xml importer...(if it's not really good and free :-) ) ThanksThomas BalkestÃ¥hl - Technical Specialist - SharePoint

How to provision custom list and import custom aspx pages automatically in sharepoint?

What is best way to create custom list (Document library) and import custom .Net pages automatically. The goal is to avoid create the list and upload those .net page to the list manually. Any code snippet that would be great help. thanks

Can I import a databse from MS Access into a SharePoint list if it contains attachments?


I have 2 issues I am trying to accomplish:

Background:  I have a SharePoint list of over 8000 entries.  This list contains Text (entries) and document attachments.  The list is approximately 400MB.  I have exported the entire SharePoint list into an Access database.  I now want to import parts of the database back into seperate SharePoint lists.

Endstate:  Break the list into seperate lists.  The seperate lists will be broken down by month.  The lists need to include all content from the original list (attachements included)

Issue 1:  Can I import only selected filtered fields into SharePoint from the Access database?

Issue 2:  Can I import the selected filtered fields to include the attachements?


Not able to Import Spreadsheet into SharePoint list.


Hello All,

I am working on WSS 3.0  and with MS Office 2007. I want to import an excel spreadsheet into SharePoint list using the feature provided under "Custom List -> Import Spreadsheet". Whenever I try to Import SpreadSheet i got following error;

Cannot connect to server at this time. Your table cannot be published.

Simultaneously, I am not able to utilize Export to Spreadsheet functionality present under " Actions => Export to Spreadsheet". Whe i tried to export the list it gives "Cannot connect to sharepoint list" error.

Can anyone help me to fix this issues?
Thanks in advance. Waiting for your valuable response.



Import and Export List data in excel sheet


Hi ,

I need to import based selective data from excel sheet and export data from sharepoint list, I'm new in Sharepoint.

can anybody guide me? What all possible ways are there and which would be the best.



Sharepoint Export Import List Items



My requirement is to export the list items in Pages library with its meta data i.e. Created Time and Modified Time.

I am trying Export Import code, but it does not import time. It imports the CreatedBy and ModifiedBY acuurately but createdTIme and Modified Time comes as current time, the time i run the import.

Pls help


private static void ExportItems()
      string exportFolder = @"C:\exports\";
      string exportFileName = "Export_File.cmp";

      using (SPSite site = new SPSite(sourceSiteUrl))
        using (SPWeb oWeb = site.OpenWeb())
          SPList oList = oWeb.Lists["Pages"];
          SPListItem oItemA = oList.GetItemById(2480);

          SPExportObject exportObject = new SPExportObject();
          exportObject.Id = oItemA.UniqueId;
          exportObject.Type = SPDeploymentObjectType.ListItem;

          SPExportSettings exportSettings = new SPExportSettings();
          exportSettings.LogExportObjectsTable = true;
          exportSettings.LogFilePath = exportFolder + "Exportlog.log";
          exportSettings.SiteUrl = sourceSiteUrl;

Import list from excel file



I try import a table from excel file to become a SharePoint list.

I want the first column in the excel to become the title column (linked to item).

I did some tests and in each tests it tooks a different column of the excel to be the sharepoint column which is "linked to item with edit menu".

What is the logic and how may i control which excel column will be that sharepoint column?


On excel sheet upload read the workbook and populate data to sharepoint list


Requirement in my current project:
In a document library when I upload an excel sheet, a specific workbook has to be read and the contents have to be uploaded to a sharepoint custom list.
The approach followed was create an event receiver and register as a feature. Following is the code for event receiver.

public override void ItemAdded(SPItemEventProperties properties)
            var list = getSPList("{150301BF-D0BD-452C-90D7-2D6CD082A247}");          
            SPListItem doc = properties.ListItem;
            doc["Msg"] = "items deleted from req list";
            string excelname=doc.File.Name;

Sharepoint 2010 List from Excel Spreadsheet to Display as Options in Infopath 2010


I have an Infopath 2010 form where I want the users to be able to display the cost of something based on the results of the data in an excel spreadsheet.

This spreadsheet does not have to stay a spreadsheet, I can import it into a List if that will make this work. So the spreadsheet has types of appraisals along the "X" axis and then individual States along the "Y" axis.

So if I am filling out the form - I want a "residential" appraisal and it is going to be in "California" - that should return the cost.

Any help woudl be appreciated. I am not sure exactly where to start.

Consume SharePoint List in Excel Services


I found some older questions regarding this but they are all listed in the Pre-SharePoint 2010 forums. I wanted to know if there is anything I can do to more easily pull data from a SharePoint List (more specifically a set of related lists) into Excel Services such that data refresh is handled as well.


I found a couple topics that used UDF as solutions to this problem, but I am not sure if they will handle data refresh. These solutions are discussed in: http://social.msdn.microsoft.com/Forums/en-US/sharepointexcel/thread/79f5c968-b68f-4d53-bfe0-d57258cfed6c and http://social.msdn.microsoft.com/Forums/en-US/sharepointexcel/thread/16f9255d-cd06-4687-ab8e-68bd6210d0f8


I am hoping the 2010 version of Excel Services can handle this more simply, thanks!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend