locked
How to import Excel sheet data to existing SharePoint List . RRS feed

  • Question

  • Hello,

    I have excel sheet, I need to upload excel sheet data to Existing SharePoint List. This SharePoint Online

     I know import to separate sheet, but I need to import excel sheet data to  existing SharePoint list.

    Wednesday, May 18, 2016 8:46 AM

Answers

  • Hi,

    We don't need write some code, we can use  Import Spreadsheet app to import your excel to a new list, then using the content and structure(Site Settings->Site Administration->Content and structure) feature to move the list data to the existing SharePoint list.

    Best Regards,

    Dennis


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Patrick_Liang Thursday, May 26, 2016 10:08 AM
    • Marked as answer by Patrick_Liang Thursday, June 2, 2016 1:24 AM
    Thursday, May 19, 2016 2:27 AM

All replies

  • Hi,

    You can write code using SharePoint client side object model to connect to sharepoint online and copy the excel sheet content

    http://alancejacob.blogspot.ca/2012/06/read-data-from-excel-file-and-insert-in.html

    Also, you can try using SSIS(SQL server Integration services).

    You can download SharePoint List adapters and install this integration adapter with visual studio BI.

    Regards,

    Amit

    Wednesday, May 18, 2016 9:18 AM
  • Hello Friend,

    1- Download this Dll which enable you to deal with Excel file.

    "https://www.dropbox.com/s/581hx72dtg48xb7/Excel%20Dll.zip?dl=0"

    2- Follow the below code.

    FileStream stream = System.IO.File.Open(path, FileMode.Open, FileAccess.Read);

    IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);

    excelReader.IsFirstRowAsColumnNames = true;
                    DataSet result = excelReader.AsDataSet();
                    using (ClientContext cc = new ClientContext(url))
                    {

     List myList = cc.Web.Lists.GetByTitle(listName);
                        while (excelReader.Read())
                        {
                            ListItemCreationInformation li = new ListItemCreationInformation();
                            ListItem myItem = myList.AddItem(li);

    myItem["Title"] = Convert.ToString(excelReader[0]);

    myItem.Update();
                                cc.ExecuteQuery();

    }

    excelReader.Close();

    ----------------------------------------------------------------------

    Please mark it as answer if it helped you :)

    Thanks.

    Wednesday, May 18, 2016 9:30 AM
  • Hi,

    We don't need write some code, we can use  Import Spreadsheet app to import your excel to a new list, then using the content and structure(Site Settings->Site Administration->Content and structure) feature to move the list data to the existing SharePoint list.

    Best Regards,

    Dennis


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Patrick_Liang Thursday, May 26, 2016 10:08 AM
    • Marked as answer by Patrick_Liang Thursday, June 2, 2016 1:24 AM
    Thursday, May 19, 2016 2:27 AM