I dont know what is worng here, its working fine in 2007, but not working in 2003
can someone please help
Sub Button2_Click()
Call COB
Call Read_Result_File
End Sub
Sub Read_Result_File()
Dim sFile, dFile As Variant
Dim i, introw, endrow As Integer
introw = Sheet2.Cells(2, 7)
endrow = Sheet2.Cells(3, 7)
On Error Resume Next
For i = introw To endrow
Sheet2.Cells(i, 2) = Sheet2.Cells(1, 7) & "\"
sFile = Sheet2.Cells(i, 1) & Sheet2.Cells(i, 2) & Sheet1.Cells(i, 2)
dFile = Sheet2.Cells(i, 1) & Sheet2.Cells(i, 2) & Sheet2.Cells(i, 3)
If Dir(sFile) <> "" Then
Sheet1.Cells(i, 3) = "File Exists"
If Dir(dFile) <> "" Then
Call GetText(dFile, i)
Else
Sheet1.Cells(i, 4) = "Feed Not Delivered"
End If
Else
Sheet1.Cells(i, 3) = "File Doesnt exists"
Sheet1.Cells(i, 4) = "Feed Not Delivered"
End If
Next i
End Sub
Sub GetText(tFile As Variant, j As Variant)
Dim oText As String
Open tFile For Input As #1
oText = Input$(LOF(1), #1)
MsgBox oText
Close
If oText = 0 Then
Sheet1.Cells(j, 4) = "Feed Delivered"
Else
Sheet1.Cells(j, 4) = "Feed Not Delivered"
End If
End Sub
Function COB()
Sheet2.Cells(1, 7) = InputBox("Enter COB Date")
Sheet2.Cells(2, 7) = InputBox("Enter int row : Range 1 to 3")
Sheet2.Cells(3, 7) = InputBox("Enter End row : Range 1 to 3")
End Function
Bookmarks