Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cannot figure out why this happens only on the lsat file found by the
getfolders().files. Any help would be great!! Set apps = fso.getfolder("c:\ds_wind").Files Do Set apps = fso.getfolder("c:\ds_wind").Files Loop While apps.Count < (Range("d1") - Date + 3) For Each Filename In apps Set fs = fso.opentextfile(Filename) txtstring = "" txtstring = fs.readall fs.close txtstring = Right(txtstring, Len(txtstring) - InStr(txtstring, "R:") - 18) txtstring = Left(txtstring, InStr(txtstring, "TOTAL:") - 1) txtarray = Split(txtstring, " ") txtarray2 = "" For i = 0 To UBound(txtarray) txtarray(i) = Trim(txtarray(i)) txtarray(i) = Replace(txtarray(i), Chr(10), "", 1, -1, vbBinaryCompare) txtarray(i) = Replace(txtarray(i), Chr(13), "", 1, -1, vbBinaryCompare) If txtarray(i) < "" And txtarray(i) < "." Then txtarray2 = txtarray2 + "," + txtarray(i) End If Next txtarray = Split(txtarray2, ",") filedate = "" & txtarray(1) & "" i = 9 If Range("a5").Value = "" Then rwidx = 5 Else rwidx = Range("a4").End(xlDown).Row + 1 End If While i < UBound(txtarray) Cells(rwidx, 1) = "'" & filedate Cells(rwidx, 2) = "'" & txtarray(i) Cells(rwidx, 3) = "'" & txtarray(i + 5) Cells(rwidx, 4) = "'" & txtarray(i + 6) Cells(rwidx, 5) = "'" & txtarray(i + 9) i = i + 10 rwidx = rwidx + 1 Wend Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File error when opening some Excel files | Excel Discussion (Misc queries) | |||
EXCEL FILES ARE NOT OPENING ERROR IS this file is not in recogniz | Excel Discussion (Misc queries) | |||
how to default WritePassword under excel workbook property for any files as long as those files are the offsprings of the parent file | Excel Programming | |||
Trying to open Excel/Word files error message "Unable to read file | Excel Discussion (Misc queries) | |||
Need a "GetFolder method" | Excel Programming |