API fill text box from text file
API fill text box from text file
(OP)
Hello
Trying to fill userform text box from a textfile with the selection from a command button. Can anyone help?
I've listed what I have below. Thanks
Private Sub cmdTest_Click()
Dim fso As New FileSystemObject
Dim Text As TextStream
Dim strTextPath As String
strTextPath = "C:\\Desktop\VariablesFolder\File.txt"
Set Text = fso.OpenTextFile(strTextPath, ForReading)
txtTest.Text = Text.ReadAll
Text.Close
End Sub
Trying to fill userform text box from a textfile with the selection from a command button. Can anyone help?
I've listed what I have below. Thanks
Private Sub cmdTest_Click()
Dim fso As New FileSystemObject
Dim Text As TextStream
Dim strTextPath As String
strTextPath = "C:\\Desktop\VariablesFolder\File.txt"
Set Text = fso.OpenTextFile(strTextPath, ForReading)
txtTest.Text = Text.ReadAll
Text.Close
End Sub





