6,868
社区成员




set objShell = CreateObject("WScript.Shell")
Set objExcel = CreateObject("Excel.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strThisPath = objShell.CurrentDirectory
Set objWorkbook = objExcel.Workbooks.Open(strThisPath & "\a.xls")
intRow = 1
do until objExcel.Cells(intRow,1).Value = ""
strResult = strResult & objExcel.Cells(intRow,1).Value & vbCrLf
Set objFile = objFSO.OpenTextFile(objExcel.Cells(intRow,1) & ".txt",2,True)
objFile.WriteLine objExcel.Cells(intRow,2)
objFile.Close
intRow = intRow + 1
loop
objExcel.Quit