How to insert row into Excel
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Can anyone explain to me how to insert a new row into and existing excel sheet? I am using the following code to try to do this but when ran, the program fails with "Insert method of range class failed" on the range.Insert statement. char locn[10]; IndexToString(nRow, nCol, locn); //convert row/col to excel notation lpDisp = objSheet.GetRange(COleVariant(locn), COleVariant(locn)); objRange.AttachDispatch(lpDisp); range.Insert(COleVariant("xlShiftDown"));