Why does the code below not work...
Why is the the variable "f" not available in Public Sub SDB() ?
Why is the the variable "f" not available in Public Sub SDB() ?
Code:
Public Sub ReadTxtImport()
On Error GoTo Err_ReadTxtImport
Dim fs As FileSystemObject, fd As Folder, fc As Files, f As File, ts As TextStream
Dim strFolder As String
strFolder = "C:\test\resultaten"
Set fs = CreateObject("Scripting.FileSystemObject")
Set fd = fs.GetFolder(strFolder)
Set fc = fd.Files
For Each f In fc
If System.PrivateProfileString(f, "System", "Type") = "SDB" Then
SDB
end If
Next
Exit_ReadTxtImport:
ts.Close
Set ts = Nothing
Set fc = Nothing
Set fd = Nothing
Set fs = Nothing
Exit Sub
Err_ReadTxtImport:
Debug.Print Err.Number, Err.Description
End Sub
_______________________________________________________________________________
Public Sub SDB()
MsgBox System.PrivateProfileString(f, "System", "Type")
End Sub