aardio 操作 EXCEL

import com.excel; 
var excelServer;
	 var oBook ; 
	 var oSheet ; 
	 excelSever = com.excel(true);
	 oBook = excelSever.WorkBooks.Add();
	 oSheet = oBook.Worksheets(1);
	 excelSever.Visible = true;
	 excelSever.windowState = -4140;
	 
	 oSheet.Cells(1,1).value2 = "aaaa";
	 oSheet.Cells(1,2).value2 = 34;
	 
	 oBook.SaveAs( io.fullpath("E:\Test\aardio\111\aaa.xls") );
	 oBook.close();
	 
	 excelSever.Quit();
	 
	 mainForm.edt_1.text = "ok";
function fu_FindExcel(strFullFileName){
	var excelServer ;
	var oBook;	//工作簿
	var oSheet; //工作表
	var RowCount,ColCount;
	var oCell ; 
	excelSever = com.excel(true);
	
	excelSever.Visible = false;	//隐藏不可见
	excelSever.alerts = false; //关闭所有操作提示
	
	oBook = excelSever.Open(strFullFileName);
	oSheet = oBook.Sheets(1);
	
	RowCount = oSheet.UsedRange.Rows.count;
	ColCount = oSheet.UsedRange.Columns.count; 
	
	oCell = oSheet.Cells(3,3).getValue2();
	
	mainForm.edt_key.text = oCell;
	
	oBook.close();
	excelSever.Quit();
}

你可能感兴趣的:(aardio,前端,excel)