In a process where I have to write datas in an existing Excel file containing formulas, I use several write cells (I’m in a for each row, and dependings of the datas I don’t have to write in every columns).
So, it’s working fine, but it takes a lot of time.
To make it quicker, I would like to go with an add data row and write every lines at the end of the process.
But in the Excel file, there is forumlas in F,G and H. Whenever I write something in D, it triggers them.
The problem is that when I try to do it with the add data rows and the following array:
Exactly, I have an Excel file in which i’m looking for some datas, if they are present I write them in some columns otherwise I write something else in another column.
So at first I wanted to write all datas with the add data row and then write in F2, G2 and H2 the formula and auto fill the column but it will erase some datas that are already written
(In my first screenshot, when there is no data in “D”, we are looking for other datas and we write them in G/H instead of the formula while when there is data in D, the formula will find value to wtire in the other cells)
That’s a nice idea but the problem is, depending on the results I have from the first Excel file (where I get the values), I may need to write in one of the next cell (and overwrite the formula)
Oh that’s very kind of you but if you have to spend time on it please don’t. I would have liked to know if something was on your mind but not to make you work on this.
It’s working, even if it could be done faster so it’s not a blocking point.
We have a couple of assign depending of the datas we find on the Excel sheet but they all look like:
Assign
To: List of String
Value: (
From row As DataRow In DataTable
Where convert.ToString(row(“Column”)).Equals(String)
Select convert.ToString(row(“Column2”))
).tolist
Then in another string:
To: String2
Value: List.FirstOrDefault
So we look into an other Excel File to look up for another value (what the formula was doing in the first place) and then put the String2 inside the add datarow.