如何vs2008使用dsoframer.ocx控件加载excel表
发布网友
发布时间:2022-04-30 11:04
我来回答
共1个回答
热心网友
时间:2022-06-21 13:00
//添加对Excel的引用
using Excel=Microsoft.Office.Interop.Excel;
private void testToolStripMenuItem_Click(object sender, EventArgs e)
{
var axapp = this.axFramerControl1.GetApplication;
if(axapp!=null)
{
//获取DSOFramer控件的Application
Excel.Application excelApp = (Excel.Application)axapp;
Excel.Workbook excelbk = excelApp.ActiveWorkbook;
Excel.Worksheet ws = excelbk.ActiveSheet;
for (int i = 1; i < 100;i++ )
ws.Cells[i, 1].value = @"Hello";
}
}