EXCEL » Api
getcellvalue
Description
특정 엑셀 셀에 대한 값을 반환하는 API이다.
Parameters
Parameters |
Type |
Description |
nRowIndex |
long |
행 인덱스(Zero-Based) |
nColumnIndex |
long |
열 인덱스(Zero-Based) |
Return Value
Type |
Description |
STRING |
셀 값 (오류 발생시 null) |
Example
function btn_on_mousedown(objInst)
{
screen.alert(obj_excel.getcellvaluebyaddr("A1"));
screen.alert(obj_excel.getcellvalue(0, 0));
PrintExcelData(obj_excel);
}
// 엑셀 파일 내 모든 시트의 모든 데이터 내용을 콘손에 출력
function PrintExcelData(obj_excel) {
var sheet_index, sheet_count, row_index, row_count, column_index, column_count;
sheet_count = obj_excel.getsheetcount();
factory.consoleprint("sheet_count = " + sheet_count);
for (sheet_index = 0; sheet_index < sheet_count; sheet_index++) {
// 작업 대상 시트 설정
obj_excel.setselectsheet(sheet_index);
// 행/열 갯수를 구함
row_count = obj_excel.getrowcount();
column_count = obj_excel.getcolumncount();
factory.consoleprint("row_count = " + row_count);
factory.consoleprint("column_count = " + column_count);
// 시트내 모든 아이템에 대한 값을 로깅
for (row_index = 0; row_index < row_count; row_index++) {
for (column_index = 0; column_index < column_count; column_index++) {
factory.consoleprint(sheet_index + ":" + row_index + ":" + column_index + " = " +
obj_excel.getcellvalue(row_index, column_index));
}
}
}
}
See Also
getcellvaluebyaddr
setcellvalue
setcellvaluebyaddr
getcelladdr
Viewer Ver.
24.3.29.1
Update Date
20240402