Right now I’m taking the previous file then making my changes and saving to a new file.
I read an oracle database and save results from a query to a data table.
I need to clear a large section of data in order to the input new data but I cannot overwrite the data as the new data might have less rows than the current data. However when I use clear range activity all the formatting etc. goes away as well. I want to set each of the values in the range to null without affecting the current formatting of the cells. My current work around is using a copy/paste range activity and copying the empty cells below the table in excel and pasting the values only.
Is there a way to create a datable that only has null values to then use in a write data table to excel activity or is there a better solution?
Basically all I’m needing to know is if there’s a way to create a data table of null values that can be entered into excel or a way of clearing an unknown size of data without using clear range activity as it gets rid of formatting also.
You can use the Clone method to create a new DataTable with the same structure as the original DataTable. This new DataTable will have the same columns but no rows or data.
newDataTable = originalDataTable.Clone()
Now that you have a new DataTable with the same structure, you can replace the original DataTable with the new one.