天软金融分析.NET函数大全 > 文档处理函数 > Excel处理函数 > Excel操作相关的类 > Txlsreadwrite类 > TxlsReadWrite方法

Insert    

简述
在指定sheet的前面插入InsertCount个sheet
定义
Insert(NameOrIndex:String|Integer;InsertCount:Integer):txlssheet;
参数
名称类型说明
NameOrIndexString|Integer字符串或序号,Sheet名或Sheet序列
InsertCountInteger整数,插入的sheet个数
返回txlssheettxlssheet对象,当指定的sheet不存在时,会报错。
  • 范例

      LJ:="E:\\TestExcel\\TslRW01.xlsx";
      obj:=CreateObject('TxlsReadWrite');
      obj.LoadFromFile("",LJ);//加载excel文件
      obj.insert('表3',2); //在“表3”前面插入2个sheet
      obj.SaveToFile('',LJ); //保存

    插入后excel结果如下:
相关
FAQ/知识库链接