开发者

excel checkboxes in c# code

开发者 https://www.devze.com 2023-03-27 13:55 出处:网络
I\'m using VS 2010 开发者_C百科c# with excel 2007. The following code works with XP OS, but not with Windows7 64bit OS:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消