'Import CSV file from Onedrive - Excel Web - Office Script

I would like to create script in order to allow user of file.xlsx stored into Onedrive to import date from file.csv (into same folder of file.xlsx into Onedrive). And then, process these data with other script.

  • Folder X

----- file.xlsx

----- file.csv

My users get access via a business licence to Excel Web (no Desktop application).

I read Office Script documentation and I didn't find function to load csv content into worksheet (via Excel Web).



Solution 1:[1]

Are you able to use Power Automate in your organization? If so, you can use the OneDrive connector to load the .csv file and create a new xlsx file. An Office Script could then fill the .xlsx file with the data by parsing the comma-separated values (here's a Stack thread on how to do that).

There's a sample that shows this whole process in the MSFT docs: Convert CSV files to Excel workbooks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexander Jerabek