pb 操作 Excel

pb 操作 Excel

 


int     ret      
string filename
string filename2
string resume

filename
= " d:\smis2\xmk.xls "
filename2
= " d:\smis2\2006050120xmk.xls "
resume
= " d:\smis2\resume.xlw "
filedelete(resume)
oleobject    xlapp,xlsub     
xlapp
= create oleobject
ret
= xlapp.connecttonewobject( " excel.sheet " )   
// ret=xlapp.connecttonewobject("excel.application")   

if     ret < 0     then      
             messagebox(
" 你的电脑未安装Excel " ,string(ret))      
             
return       
end    
if       
xlapp.application.workbooks.open(filename)      
xlsub
= xlapp.application.activeworkbook.worksheets[ 1 ]      

xlsub.cells[
4 , 2 ].value = " 我是吴吴 "

xlapp.saveas(filename2,
true )
messagebox(
" aa " , " aa " )
xlapp.application.save(
'   ' )
// xlapp.application.close()
xlapp.application.quit()
xlsub.disconnectobject()
xlapp.disconnectobject()
destroy xlsub
destroy xlapp



你可能感兴趣的:(pb 操作 Excel)