Here is the code:
Option Explicit
Private Sub CommandButton1_Click()
Dim fs As Object
Dim a As Object
Dim text As String, folderpath As String
Unload UserForm1
Set fs = CreateObject("Scripting.FileSystemObject")
folderpath = "C:\Users\Bogdan\Desktop\excelforum\rp1783\"
Set a = fs.CreateTextFile(folderpath & "configfile.txt", True)
text = Me.Label1.Caption & Me.TextBox1.text & vbCrLf & _
Me.Label2.Caption & Me.TextBox2.text & vbCrLf & _
Me.Label3.Caption
a.WriteLine (text)
a.Close
Call Shell("explorer.exe" & " " & folderpath, vbNormalFocus)
End Sub
And the attached file
Bookmarks