Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Interop Excel

Interop Excel

Scheduled Pinned Locked Moved COM
comarchitecture
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mithun narayanan
    wrote on last edited by
    #1

    Hi all, i am using Interop for excel. i need to set border style as solid and border color for particular cells. am using the following code, which is not working.... Please correct it... oRange = (Excel.Range)oSheet.Cells[i, j+1]; oRange.Borders.Weight = BorderStyle.Solid; oRange.Cells.Borders.ColorIndex = 11; Thanks and regards

    C G 2 Replies Last reply
    0
    • M mithun narayanan

      Hi all, i am using Interop for excel. i need to set border style as solid and border color for particular cells. am using the following code, which is not working.... Please correct it... oRange = (Excel.Range)oSheet.Cells[i, j+1]; oRange.Borders.Weight = BorderStyle.Solid; oRange.Cells.Borders.ColorIndex = 11; Thanks and regards

      C Offline
      C Offline
      cariolihome
      wrote on last edited by
      #2

      What error has occurred ?

      1 Reply Last reply
      0
      • M mithun narayanan

        Hi all, i am using Interop for excel. i need to set border style as solid and border color for particular cells. am using the following code, which is not working.... Please correct it... oRange = (Excel.Range)oSheet.Cells[i, j+1]; oRange.Borders.Weight = BorderStyle.Solid; oRange.Cells.Borders.ColorIndex = 11; Thanks and regards

        G Offline
        G Offline
        gg4237
        wrote on last edited by
        #3

        Hi, maybe you should check out GemBox.Spreadsheet .NET Excel component for reading and writing XLS, XLSX, ODS, CSV and HTML files. Here is an example code how to set border for specified cells:

        ExcelFile ef = new ExcelFile();

        // Loads Excel file.
        ef.LoadXls("filename.xls");

        // Selects first worksheet.
        ExcelWorksheet ws = ef.Worksheets[0];

        // Set border for selected cells.
        cr = ws.Cells.GetSubrange("I2", "L8");
        cr.SetBorders(MultipleBorders.Outside, Color.Navy, LineStyle.Dashed);

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups