ExcelSetCells2
简述
设置指定的Excel中的指定的Sheet的区域的数据值
注:此函数无需依赖office/wps,但需要关闭文件。
ExcelSetCells2(ExcelFileName:String;ExcelSheetName:String;Row:Integer;Col:Integer;Row2:Integer;Col2:Integer;Value:Array):Integer
名称 | 类型 | 说明 |
---|
ExcelFileName | String | 字符串,Excel文件名 |
ExcelSheetName | String | 字符串,Sheet名 |
Row | Integer | 整数,指定行 |
Col | Integer | 整数,指定列 |
Row2 | Integer | 整数,指定行 |
Col2 | Integer | 整数,指定列 |
Value | Array | 数组,设置的指定区域的值 |
返回 | Integer | 整数。如果成功则返回真,如果指定的文件不存在或者指定的Sheet不存在或者失败则返回假。 |
//设置本地文件C:\VBA.xlsx第1行到到第5行,第1列到第5列的数据
dir:="C:\\VBA.xlsx";
sheet:="Sheet1";
v:=rand(5,5);
ret:=rdo2 ExcelSetCells2(dir,sheet,1,1,5,5,v);
return ret;