Results 1 to 6 of 6

Processing Multiple Files

Threaded View

  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    32

    Processing Multiple Files

    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.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1