MILY: 仿宋_GB2312; mso-hansi-font-family: 宋体">如何在PB中统计EXCEL文件的行列数?
问题描述:
如何在PB中统计EXCEL文件的行列数?
解决方案:
OLEObject OLE_MyExcel
OLE_MyExcel =Create OLEObject
OLE_MyExcel. ConnectToNewObject("excel.Application")
OLE_MyExcel.visible=false
OLE_MyExcel.Workbooks.Open("c:\xxx.xls")
messagebox("rows",string(OLE_MyExcel.ActiveWorkbook.Activesheet.UsedRange.Rows.Count))
OLE_MyExcel.quit()
OLE_MyExcel.DisConnectObject()
destroy OLE_MyExcel