K
Kim Skatun
I am trying to get the foldername into a textbox of my gui by using the
FileDialog box. I have some problem to get it to work:
Public Sub ReadDirectoryNames()
Dim FileName As Variant
Dim Filt As String, Title As String
Dim Response As Integer
' Set Drive letter
ChDrive "C:\"
' Set to Specified Path\Folder
ChDir "C:\plot\"
FilterIndex = 5
' Set Dialogue Box Caption
Title = "Kims file selector"
' Get FileName
FileName = Application.FileDialog(Title:=Title)
' Exit if Dialogue box cancelled
If FileName = False Then
Response = MsgBox("No File was selected", vbOKOnly & vbCritical,
"Selection Error")
Exit Sub
End If
' Display Full Path & File Name
Response = MsgBox("You selected " & FileName, vbInformation, "Proceed")
GUI.TextBoxDirectoryName.Text = FileName
Call ReadText(FileName)
GUI.TabbedPane.Pages(2).Visible = True
End Sub
FileDialog box. I have some problem to get it to work:
Public Sub ReadDirectoryNames()
Dim FileName As Variant
Dim Filt As String, Title As String
Dim Response As Integer
' Set Drive letter
ChDrive "C:\"
' Set to Specified Path\Folder
ChDir "C:\plot\"
FilterIndex = 5
' Set Dialogue Box Caption
Title = "Kims file selector"
' Get FileName
FileName = Application.FileDialog(Title:=Title)
' Exit if Dialogue box cancelled
If FileName = False Then
Response = MsgBox("No File was selected", vbOKOnly & vbCritical,
"Selection Error")
Exit Sub
End If
' Display Full Path & File Name
Response = MsgBox("You selected " & FileName, vbInformation, "Proceed")
GUI.TextBoxDirectoryName.Text = FileName
Call ReadText(FileName)
GUI.TabbedPane.Pages(2).Visible = True
End Sub