开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜