Excel 2007 Interop Not Behaving correctly
-
Tuesday, July 15, 2008 9:27 PM
All,
I've gone through several iterations on this and am convinced that Excel\Interop is simply not doing what it should....
2 examples:
I can open worksheets, select ranges, etc but I cannot Insert data\values (or formulas) into the cell (the cells or worksheet are NOT Protected).
I "Can" insert a comment into the cell and I "Can" get "Replace" to work.....
code:
//this works
StartRange.Replace(StartRange.Value2, "Start", m, m, m, m, m, m);
//this does not work (no error....just no result)
StartRange.Text = "Start";
//This does not work
StartRange.FormulaR1C1 = "Foo";
furthermore, I simply CANNOT Insert A row (I need to do this individually and by blocks of rows)
//doesnt work (Again, no error at all, just no result behavior that effects sheet)
range.EntireRow.Insert(Microsoft.Office.Interop.Excel.XlInsertShiftDirection.xlShiftDown, Microsoft.Office.Interop.Excel.XlInsertFormatOrigin.xlFormatFromLeftOrAbove);
//this alos doesnt work.....
sheet.Rows.Insert(Microsoft.Office.Interop.Excel.XlInsertShiftDirection.xlShiftDown, Microsoft.Office.Interop.Excel.XlInsertFormatOrigin.xlFormatFromLeftOrAbove);
(I am Positive that the range and sheet objects are valid here.....)
Please help.
Thanks
Greg Jackson
PDX, Oregon
Gregory A Jackson- Moved by jack 321 Friday, July 18, 2008 8:14 AM off topic for C# general
All Replies
-
Friday, July 18, 2008 8:14 AM
Discussions in office development
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.officedev&lang=en&cr=US
Please remember to mark the replies as answers if they help and unmark them if they provide no help.