|
下边这段代码是拿来别人的用,由于对编程语言不熟悉,调试好久,通过了,但是没有结果导出~~~,不知道什么原因,请高手指点
Function CreateExcel( )
Set Excelapp=CreateObject("Excel.Application")
ExcelApp.Workbooks.App
ExcelApp.Visible=True
Set CreatExcel=ExcelApp
End Function
Function PutValueInfile(sfilePath,ishee,irow,icolumn,value)
Set ExcelObj=CreateObject("Excel.Application")
ExcelObj.Workbooks.Open sfilePath
Set NewSheet=ExcelObject.Sheet.Item(isheet)
NewSheet.Cells(irow,icolumn)=value
ExcelObj.Application.Quit
Set ExcelObj=Nothing
GetValueInFile=value
End Function
Function MemoryCollection(T1,T2,Processname,sfilename)
Set ExcelObj=CreateObject("Excel.Application")
ExcelObj.workbooks.Open sfilename
Set NewSheet=ExcelObj.Sheets.Item(3)
Set oShell = CreateObject("WSCript.shell")
oShell.run"Taskmgr.exe"
Dialog("regexpwndtitle:=Windows 任务管理器").Minimize
For i=1 to T1
Memory = Dialog("nativeclass:=#32770","regexpwndtitle:=windows 任务管理器","text:=windows 任务管理器").Winlistview("regexpwndclass:=Syslistview32","window id:=1009").GetSubItem(Processname,"内存使用")
value=date&"_"&Time&":"&ProcessName&"内存使用情况:"&NewSheet.cells(i+1,1)=value
wait T2
Next
Set oShell=Nothing
ExcelObj.ActiveWorkbook.Save
ExcelObj.Application.Quit
Set ExcelObj=Nothing
Dialog("regexpwndtitle:=Windows 任务管理器").Close
End Function
MemoryCollection 2,1,"zwcad.exe","E:\qtptest\复件 saveas\data1.xls"
[ 本帖最后由 gily19821116 于 2009-8-21 17:34 编辑 ] |
|