I think you're missing the point of my comment about your hhh variable. The way your code is now your obr9f, a, i, j, and k variables will never contain anything because you fill hhh and then immediately set it to vbNullString. If you don't set it to vbNullString the variables willl all contain the same value. The following is some code that shows both cases. Paste it into a new project and try it.
Regarding this code:Code:Dim hhh As String Dim obr9f As String Dim obr9a As String Dim obr9i As String Dim obr9j As String Dim obr9k As String hhh = "fullscan" hhh = vbNullString obr9f = Mid(hhh, InStr(hhh, " ") + 1) obr9a = Mid(hhh, InStr(hhh, " ") + 1) obr9i = Mid(hhh, InStr(hhh, " ") + 1) obr9j = Mid(hhh, InStr(hhh, " ") + 1) obr9k = Mid(hhh, InStr(hhh, " ") + 1) MsgBox obr9f MsgBox obr9a MsgBox obr9i MsgBox obr9j MsgBox obr9k 'do it again without the vbNullstring line hhh = "fullscan" obr9f = Mid(hhh, InStr(hhh, " ") + 1) obr9a = Mid(hhh, InStr(hhh, " ") + 1) obr9i = Mid(hhh, InStr(hhh, " ") + 1) obr9j = Mid(hhh, InStr(hhh, " ") + 1) obr9k = Mid(hhh, InStr(hhh, " ") + 1) MsgBox obr9f MsgBox obr9a MsgBox obr9i MsgBox obr9j MsgBox obr9k
You don't need to open and immediately close the file in order to create/ set up the file on the hard drive for the list count. Just do the Open sErrorLogPath For Append As #hFile when you need it. VB will create the file if it's not already there even though you specified Append.Code:Open sErrorLogPath For Output As #hFile Close #hFile If List2.ListCount > 1000 Then List2.Clear Close #hFile hFile = FreeFile Open sErrorLogPath For Append As #hFile




Reply With Quote
