Dear All,

I am using Visual Studio 2010 Pro, on Windows XP Pro. I have written a programme which reads from one Excel 2010 file and writes to another; this part works fine, but I want to insert a new blank row with the following:

Code:
 objMainWorksheet.Rows.EntireRow.Insert()
However, I get the following error message:

“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.”

I have tried this and I still get the message. Also, I tried to insert this in a Macro and that inserts the row without comment.

Does anyone know what I am doing wrong?

Regards,

john