locked
Difference in layout when import a csv-file to excel in code and doing it manually. RRS feed

  • Question

  • Dear Experts,

    I have code that exports a SharePoint list to a .csv-file. Then I have a function that converts it to a XLSX. Everything works fine. But when I for example import the csv-file manually in Excel I get my list in a certain layout. And when I use the code it doesn't. Is it possible to get that layout too in code?

    Gr. P


    • Edited by PeetK Thursday, January 24, 2019 7:24 AM
    Thursday, January 24, 2019 7:16 AM

Answers

  • Too get that table you have to "Load" the data and not import it.  Search for examples of loading to a table from code.


    \_(ツ)_/

    • Marked as answer by PeetK Thursday, January 24, 2019 8:11 AM
    Thursday, January 24, 2019 7:37 AM

All replies

  • Your template is not set up to apply to an import.  TO apply a template you must define the import to target a table in the conversion code.


    \_(ツ)_/

    Thursday, January 24, 2019 7:33 AM
  • Too get that table you have to "Load" the data and not import it.  Search for examples of loading to a table from code.


    \_(ツ)_/

    • Marked as answer by PeetK Thursday, January 24, 2019 8:11 AM
    Thursday, January 24, 2019 7:37 AM
  • Could you give me an example?
    Thursday, January 24, 2019 7:38 AM
  • Thanks for the info I have found it. The answer was Powershell-module: "PSExcel". That does the trick in just on line of code. Gr. P
    Thursday, January 24, 2019 8:11 AM