using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop.Excel;
using NPOI;
using NPOI.SS.UserModel;
using NPOI.HSSF.UserModel;
using NPOI.SS.Util;
using NPOI.HSSF.Util;
using NPOI.XSSF.UserModel;
using System.IO;
namespace CDQuantitySheet
{
public class ExcelHelp
{
//HSSFWorkbook wk = null;
IWorkbook wk;
bool xls = true;
public ExcelHelp( string fileNameS)
{
string tempPath = fileNameS;
string fileExt = Path.GetExtension(tempPath);
using (var fs = new FileStream(tempPath, FileMode.Open, FileAccess.Read))
{
if (fileExt == ".xls")
{
wk = new HSSFWorkbook(fs);
xls = true;
NOPI向Excel单元格写入数字、字符
最新推荐文章于 2023-12-22 21:16:18 发布