Hi All,
I have an application in which i gets two input from user namely the Config file location and Input file Location.These values are stored as TextBox values.
Later when i click the process button,the files are been processed.
Currently it process only one file...as the user select the Input file as Filename rather than the Folder name....
Now i have a requirement in which user just select the InputFile Folder and all files under it with extension .csv are processed one by one.
The codes for the Steps are given below.
Private Sub cmd_browseConfig_Click() ' code which choose config file
strchosenfile = Application.GetOpenFilename()
TextBox1.Value = strchosenfile
End Sub
Private Sub Cmd_browseFolder_Click() ' code which opens the Folder to be selected by user
Dim FName As String
FName = BrowseFolder(Caption:="Select A Folder")
If FName = vbNullString Then
Debug.Print "No Folder Selected"
Else
Debug.Print "Selected Folder: " & FName
End If
TextBox2.Value = FName ' The complete path is stored in TextBox2.Value
End Sub
Private Sub cmd_cancel_Click()
blnDoProcessing = False
Me.Hide
End Sub
Private Sub cmd_process_Click() ' Process Command Button code
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox "Both files must be specified before generating Wafermap. Try again."
Else
blnDoProcessing = True
Me.Hide
End If
End Sub
The workbook Open method is as below
Private Sub Workbook_Open()
Wafermap.Show
strConfigFile = Wafermap.TextBox1.Value
strInputFile = Wafermap.TextBox2.Value
Unload Wafermap
If blnDoProcessing Then
Call CreateWaferMap
Else
MsgBox "Processing canceled."
End If
End Sub
Please help to call CreateWafermap for each .CSV file in the Folder one by one.
Find the attachment for more information.
Bookmarks