运行代码:
class Program
{
static void Main(string[] args)
{
FileStream file = new FileStream("test.xlsx", FileMode.Open);//读入excel模板
IWorkbook workbook = new XSSFWorkbook(file);
workbook.RemoveSheetAt(0);
file = new FileStream("test1.xlsx", FileMode.Create);//写入excel
workbook.Write(file);
file.Close();
}
}
执行完成后,使用鼠标打开test1.xlsx文件,报丢失信息错误
Comments: ** Comment from web user: skyv158 **
class Program
{
static void Main(string[] args)
{
FileStream file = new FileStream("test.xlsx", FileMode.Open);//读入excel模板
IWorkbook workbook = new XSSFWorkbook(file);
workbook.RemoveSheetAt(0);
file = new FileStream("test1.xlsx", FileMode.Create);//写入excel
workbook.Write(file);
file.Close();
}
}
执行完成后,使用鼠标打开test1.xlsx文件,报丢失信息错误
Comments: ** Comment from web user: skyv158 **
test.xlsx文件是测试文件。