Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Merging Cells from C# and Interop
Merging Cells from C# and Interop
Using Excel 2003 I am trying to merge some cells from C# code: Code: Excel.ApplicationClass xApp; //Excel App Excel.Workbook tWB; //Target Workbook Excel.Worksheet tWS; //Target Worksheet Excel.Range tR; //Target Range holder //Start up Excel xApp = new Microsoft.Office.Interop.Excel.ApplicationClass(); //Create the new Workbook and get the sheet tWB = xApp.Workbooks.Add(Type.Missing); tWB.Worksheets.Add(Type.Missing, Type.Missing, 1, Excel.XlSheetType.xlWorksheet); tWS = (Excel.Worksheet)tWB.Worksheets.get_Item(1); //Report Title tR = tWS.get_Range("A1", "M1"); tR.Font.Size = 20; tR.Font.Bold = true; tR.ShrinkToFit = false; tR.MergeCells = true; tR.Value2 = "Summary Revenue Report"; Not sure why the range is never merged, I try the same thing from VBA (using VBA cade) and it works, but this C# does everything but merge the cells.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
merging cells and eliminating spaces for empty cells | Excel Discussion (Misc queries) | |||
Formula for merging cells/re sizing cells | Excel Discussion (Misc queries) | |||
merging cells together but keeping all data from the cells | Excel Discussion (Misc queries) | |||
Merging cells | Excel Discussion (Misc queries) | |||
Merging cells | Excel Worksheet Functions |