Click here to Skip to main content
16,009,238 members
Home / Discussions / C#
   

C#

 
GeneralDatagridview... Pin
Isaac Gordon2-Jul-09 2:55
Isaac Gordon2-Jul-09 2:55 
GeneralRe: Datagridview... Pin
Henry Minute2-Jul-09 4:01
Henry Minute2-Jul-09 4:01 
GeneralRe: Datagridview... Pin
musefan2-Jul-09 4:15
musefan2-Jul-09 4:15 
QuestionWrting Image data in Mifare 1k card Pin
GauravKP2-Jul-09 2:43
professionalGauravKP2-Jul-09 2:43 
AnswerRe: Wrting Image data in Mifare 1k card Pin
Rajesh R Subramanian2-Jul-09 3:07
professionalRajesh R Subramanian2-Jul-09 3:07 
Questionwhat do i have to do next Pin
j4ck1we2-Jul-09 2:20
j4ck1we2-Jul-09 2:20 
AnswerRe: what do i have to do next Pin
dojohansen2-Jul-09 2:27
dojohansen2-Jul-09 2:27 
JokeRe: what do i have to do next Pin
musefan2-Jul-09 2:34
musefan2-Jul-09 2:34 
AnswerRe: what do i have to do next Pin
musefan2-Jul-09 2:30
musefan2-Jul-09 2:30 
AnswerRe: what do i have to do next Pin
j4ck1we2-Jul-09 7:32
j4ck1we2-Jul-09 7:32 
QuestionIOException and Number formatting Pin
Megidolaon2-Jul-09 1:55
Megidolaon2-Jul-09 1:55 
AnswerRe: IOException and Number formatting Pin
Luc Pattyn2-Jul-09 2:02
sitebuilderLuc Pattyn2-Jul-09 2:02 
AnswerRe: IOException and Number formatting Pin
stancrm2-Jul-09 2:06
stancrm2-Jul-09 2:06 
GeneralRe: IOException and Number formatting Pin
musefan2-Jul-09 2:21
musefan2-Jul-09 2:21 
AnswerRe: IOException and Number formatting Pin
musefan2-Jul-09 2:11
musefan2-Jul-09 2:11 
AnswerRe: IOException and Number formatting Pin
Henry Minute2-Jul-09 2:13
Henry Minute2-Jul-09 2:13 
GeneralRe: IOException and Number formatting Pin
musefan2-Jul-09 2:17
musefan2-Jul-09 2:17 
GeneralRe: IOException and Number formatting Pin
Henry Minute2-Jul-09 2:20
Henry Minute2-Jul-09 2:20 
GeneralRe: IOException and Number formatting Pin
musefan2-Jul-09 2:23
musefan2-Jul-09 2:23 
AnswerRe: IOException and Number formatting Pin
Megidolaon2-Jul-09 11:27
Megidolaon2-Jul-09 11:27 
QuestionMifare RFID reader with GNET Plus protocol Pin
GerritdL2-Jul-09 1:43
GerritdL2-Jul-09 1:43 
AnswerRe: Mifare RFID reader with GNET Plus protocol Pin
Henry Minute2-Jul-09 2:17
Henry Minute2-Jul-09 2:17 
AnswerRe: Mifare RFID reader with GNET Plus protocol Pin
GerritdL6-Jul-09 20:17
GerritdL6-Jul-09 20:17 
GeneralRe: Mifare RFID reader with GNET Plus protocol Pin
Muhammad Yousuf Maher16-Jul-14 3:04
Muhammad Yousuf Maher16-Jul-14 3:04 
Questionexception trying to insert a range to an Excelsheet Pin
Harry6662-Jul-09 1:23
Harry6662-Jul-09 1:23 
Hello there,

I am programming C# using MS Visual Studio Professional Edition 2008 and MS Office Excel 2007.
My Problem is that I want to mark a range, copy and insert it at the same position shifting existing cells down. I can do this with the Excel GUI - no problem. But programmatically I get a System.Runtime.InteropServices.COMException, telling me that the Insert-method of the Range-object could not be executed (German text:"Die Insert Methode des Range-Objektes konnte nicht ausgeführt werden.").

The range I want to copy has got some special formats (font, color, some merged cells), and I need these for each entry I have to insert.

I am trying this code
<pre>
Excel.Worksheet sheet = (Excel.Worksheet)wb.Sheets["mySheet"]; // wb is the actual workbook
Excel.Range range = sheet.get_Range(sheet.Cells[16, 1], sheet.Cells[18, 37]);// this is "A16:AK18"
range.Insert(Excel.XlInsertShiftDirection.xlShiftDown, range);
</pre>

Here come the questions:
Why can I not insert the range? What are possible reasons?
How can I insert the desired range?

Thanks in anticipation!
Harry

no plan,
no signature

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.