ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inserting a row (https://www.excelbanter.com/excel-programming/361438-inserting-row.html)

Elena

inserting a row
 
I'm using VB.NET to create an application that opens an Excel worksheet.

I need to insert a row.

I've tried to use the code:


CoverWS.Rows.Insert(18)

I am getting an error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in mscorlib.dll

Additional information: Cannot shift objects off sheet.

Can anyone tell me what I'm doing wrong?

Thanks in Advance!!




Bob Phillips[_6_]

inserting a row
 
Maybe

CoverWS.Rows(18).Insert


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Elena" wrote in message
...
I'm using VB.NET to create an application that opens an Excel worksheet.

I need to insert a row.

I've tried to use the code:


CoverWS.Rows.Insert(18)

I am getting an error:

An unhandled exception of type

'System.Runtime.InteropServices.COMException'
occurred in mscorlib.dll

Additional information: Cannot shift objects off sheet.

Can anyone tell me what I'm doing wrong?

Thanks in Advance!!







All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com