Update Values in Excel Directly

Is there a way to directly update values in excel? Not using Datatable first. I wasn’t able to find anything solid on the forums. For example: I have an excel file with two columns (Files, Status). I need to set “Status” to ‘N/A’ if “Files” column value is null.


1 Like

I too prefer the way other scripting languages do it like in VBS/VBA you could do workbook.Sheet(0).Cells(1,1).Value and get or store the value direct. Only way I know right now is Write Cell, but datatables work well.

There is a Workbook Application variable with the Excel scope which is similar to that of an Workbook object in VB. There might be something there, cause you can do for example, wb.GetSheets(0) and there could be other functionality with that.

You can use Write Cell then use the Datatable to determine the location of the cell using LINQ and Array.IndexOf functions. That’s how I have currently done it like to add Excel formulas mainly.

1 Like

One way which I have tried in the past and vaguely remember

Wb.SetSheet - using invoke method to set currentsheet
Wb.Currentsheet.xxxx functions - explore this