excel checkboxes in c# code
I'm using VS 2010 开发者_C百科c# with excel 2007.
The following code works with XP OS, but not with Windows7 64bit OS:
OLEObject ole = (OLEObject)excelWorksheet.OLEObjects("Checkbox1");
((Microsoft.Vbe.Interop.Forms.CheckBox)ole.Object).set_Value("true");
I'm using Microsoft.Vbe.Interop.Forms.dll. I checked platform of this dll- it's anyCPU. other code works fine.
Does anyone know why? Thanks
You could use OpenXml that you can find on Codeplex or using your NuGet package manager. It is a bit more comfortable tu use and gives you wider possibilities (in my opinion) than the excell interop class.
精彩评论