跳到主要内容

write_all

  • 将表格数据写入指定文件的指定的单个表格中,覆盖式写入

声明

mixed write_all(string path, array arr, int sheet = 0)

参数

参数名描述
pathexcel文件的路径
arr需要写入的数组数据
sheetsheet编号,默认0

返回值

返回ExcelErrorCode

使用方式

// 将new_data_arr写入excel的sheet0,覆盖式写入
array new_data_arr = [[1, 2, 3, 4, 5], [6, 7]]; //应为二维数组
int sheet_num = 0;
excel.write_all("sample/test.xlsx" , new_data_arr, 0);

返回文档