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
R

Ray2Boston

@Ray2Boston
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Editing a Textbox and CheckBox in Excel file using Interop
    R Ray2Boston

    I assume here that you can get the Excel, Workbook and Worksheet objects... String sFileName = <full path to file>; Microsoft.Office.Interop.Excel.Application oApp = new Microsoft.Office.Interop.Excel.Application(); Workbook wkb = oApp.Workbooks.Open(sFileName, .....); Worksheet sheet1 = wkb.Worksheets["Sheet 1"] as Worksheet; Microsoft.Office.Interop.Excel.CheckBox cb = sheet1.CheckBoxes("Check Box 101"); ...the rest should be obvious. For example, cb.Value = true; That's the code. The non-obvious part to me was the name - in this case "Check Box 101". In the upper left corner of Excel, as you click from cell to cell, it shows the name of the cell. For example, A1, A2, etc... If you RMB on the CheckBox it will show the name of the CheckBox in this very same location. You can change the name to whatever you want. That's the name you use in code to access the CheckBox from the list. Excel will auto-name them so there is some predictability. But I've received spreadsheets where the names are all over the map. Good luck!

    C# csharp com tutorial
  • Login

  • Don't have an account? Register

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