老实说,没看懂。- Dim objExcel
- strPath=Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))
- Set objExcel=CreateObject("Excel.Application")
- objExcel.WorkBooks.Open(strPath&"1.xls")
- objExcel.DisplayAlerts=false
- objExcel.visible=false
- objExcel.SheetsInNewWorkBook=2
- row=1
- do until objExcel.Workbooks(1).WorkSheets(1).Cells(row,1).value=""
- WriteToFile objExcel.Cells(row,1),objExcel.Cells(row,2),objExcel.Cells(row,3)
- row=row+1
- loop
-
- objExcel.ActiveWorkBook.Close
- Set objExcel=Nothing
- objExcel.Quit()
-
-
- Sub WriteToFile(col1,col2,col3)
- Dim objFSO
- Set objFSO=WScript.CreateObject("Scripting.FileSystemObject")
- Set f=objFSO.CreateTextFile(strPath&col1&".txt",True)
- f.WriteLine("["+col1+"]"+"####"+"["+col2+"]"+"####"+"["+col3+"]")
- f.Close
- Set f=Nothing
- Set objFSO=Nothing
- End Sub
复制代码
|