0

I want to get a full styling in Excel sheet's cells like merging, coloring and font sizing. Now I am using Microsoft.Office.Interop.Excel library for this but I am getting confused to use it.

this is code that I am using for now

            Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
            excelApp.Application.Workbooks.Add(Type.Missing);
            excelApp.Columns.ColumnWidth = 20;
            excelApp.Cells[7, 1].Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeLeft].Weight = 1d;

I also want to make merging cell, style border and coloring too.Can somebody help to with an example code please??

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Muhammad Usman
  • 1,366
  • 5
  • 18
  • 33

1 Answers1

0

Thanks who try to solve my problem and I found this solution for my own question problem

            // what is here merging    
            excelApp.Range[excelApp.Cells[2, 2], excelApp.Cells[2, 5]].Merge();

            // what is here boarder
            excelApp.Range[excelApp.Cells[1, 1], excelApp.Cells[1, 2]].Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeLeft].Weight = 3d;
Muhammad Usman
  • 1,366
  • 5
  • 18
  • 33