Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to programmatically insert formulas into a csv file using vb.net?

Tags:

csv

vb.net

I need to add formulas to a CSV file that already exists. Is this possible to do this using VB.Net?

The idea is I already have a CSV file and I need one column to be populated in each cell with a custom formula. This has to be done programmatically because these files are being created dynamically.

Does anyone know how to do this? Thanks.

like image 723
TWhite Avatar asked Jun 11 '13 15:06

TWhite


People also ask

Can you put formulas in a CSV file?

CSV – a comma-separated values file. AKA Character Separated Values, or Comma Delimited file. CSV files differ from traditional spreadsheet programs because you can only have a single sheet without the saved cell, column, or row values. You also can't save formulas into a CSV file.

Is there a way to import data from .CSV to active Excel sheet?

In Excel 365, Excel 2021, Excel 2019 and Excel 2016, you can import data from a text file by connecting to it with the help of Power Query. Here's how: On the Data tab, in the Get & Transform Data group, click From Text/CSV. In the Import Data dialog box, select the text file of interest, and click Import.

What features are not compatible with CSV?

csv. They differ from other spreadsheet file types in that you can only have a single sheet in a file, they cannot save cell, column, or row styling, and cannot save formulas.


1 Answers

1,2,3,=SUM(A1:C1)

Surprised me when I tried it, but Excel will keep the formula.

You can even export formulas into a CSV by first displaying them on screen. (Ctrl-`)

like image 105
Greg Little Avatar answered Sep 17 '22 15:09

Greg Little