We get an excel worksheet from a customer and there is a data discrepancy with one of the col. the item description they send. We want to programmatically open the document lookup the table using item column, and then write a new column with the item description from the table (on SQLSever) that part of getting the data is fine but how to create such a new column is where I am stumped. writing in asp.net but open to however it can be done
I am getting this error when trying to insert a column:
To prevent possible loss of data, Excel cannot shift nonblank cells
off of the worksheet. Select another location in which to insert new
cells, or delete data from the end of your worksheet.If you do not have data in cells that can be shifted off of the
worksheet, you can reset which cells Excel considers nonblank. To do
this, press CTRL+End to locate the last nonblank cell on the
worksheet. Delete this cell and all cells between it and the last row
and column of your data then save.
This problem is not linked to your code, it happens when you have data on the last column (and so Excel do not want you to loose it).
Yet, the trick is Excel considers that any style is the same as data. So, if you have ever defined a style on the whole row, inserting a column may cause this error.
Let me give an example to explain it more:
Have a look at your file to solve this issue (IMHO, defining style on a whole row is a bad practice because it could cause this kind of error).