Import JP. ne. so_net.ga2.no_ji.jcom.releasemanager;
Import JP. ne. so_net.ga2.no_ji.jcom.excel8.excelapplication;
Import JP. ne. so_net.ga2.no_ji.jcom.excel8.excelworkbook;
Import JP. ne. so_net.ga2.no_ji.jcom.excel8.excelworkbooks;
Import JP. ne. so_net.ga2.no_ji.jcom.excel8.excelworksheet;
Public class excelprinter {
Public Boolean print (string fname ){
Releasemanager Rm = new releasemanager ();
Try {
Excelapplication Excel = new excelapplication (RM );
Excelworkbooks xlbooks = excel. workbooks ();
Excelworkbook xlbook = xlbooks. Open (fname );
Excelworksheet xlsheet = excel. activesheet ();
Xlsheet. printout ();
Xlbook. Close (false, null, false );
Excel. Quit ();
} Catch (exception e ){
E. printstacktrace ();
Return false;
} Finally {
Rm. Release ();
}
Return true;
}
Public static void main (string [] ARGs ){
Excelprinter test = new excelprinter ();
Try {
Test. Print ("C: // todolist(2007-06-152.16.xls ");
} Catch (exception e ){
E. printstacktrace ();
}
}
}