+ Reply to Thread
Results 1 to 5 of 5

Populating Combo Boxes Still Not Working

  1. #1
    Tyrell
    Guest

    Populating Combo Boxes Still Not Working

    For some reason I still cannot get the combo boxes to populate using the code
    below. Does anyone have any other recommendations on how I could get this to
    work? Thank you to the gentleman who helped me earlier with this but it's
    still not working. Any help would be greatly appreciated !


    Private Sub Populate_cboSOperations()

    'Populate Combo Box cboSOperations

    Dim FSO As Object
    Dim sFolder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object
    'Dim This As Object

    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set This = ActiveWorkbook
    Folder = "C:\Ag Valley\Tracker"

    If Folder <> "" Then
    Set sFolder = FSO.GetFolder(Folder)
    Set Files = sFolder.SubFolders
    cboSOperation.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSOperation.AddItem file.Name
    End If
    Next file
    End If

    Set FSO = Nothing
    End Sub

    Private Sub cboSOperation_Change()

    'Populate Combo Box cboSGrower

    Dim FSO1 As Object
    Dim s1Folder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object
    'Dim This As Object

    Set FSO1 = CreateObject("Scripting.FileSystemObject")
    Set This = ActiveWorkbook
    Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"

    If cboSOperation.Value <> "" Then
    Set s1Folder = FSO1.GetFolder(Folder)
    Set Files = s1Folder.SubFolders
    cboSGrower.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSGrower.AddItem file.Name
    End If
    Next file
    End If

    Set FSO1 = Nothing
    End Sub

    Private Sub cboSGrower_Change()

    'Populate Combo Box cboSYear

    Dim FSO2 As Object
    Dim s2Folder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object
    'Dim This As Object

    Set FSO2 = CreateObject("Scripting.FileSystemObject")
    Set This = ActiveWorkbook
    Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    Trim(cboSGrower.Value) & "\"

    If cboSGrower.Value <> "" Then
    Set s2Folder = FSO2.GetFolder(Folder)
    Set Files = s2Folder.SubFolders
    cboSYear.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSYear.AddItem file.Name
    End If
    Next file
    End If

    Set FSO2 = Nothing
    End Sub

    Private Sub cboSYear_Change()

    'Populate Combo Box cboSFile

    Dim FSO3 As Object
    Dim s3Folder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object
    'Dim This As Object

    Set FSO3 = CreateObject("Scripting.FileSystemObject")
    Set This = ActiveWorkbook
    Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"

    If cboSYear.Value <> "" Then
    Set s3Folder = FSO3.GetFolder(Folder)
    Set Files = s3Folder.SubFolders
    cboSFile.Clear
    For Each file In Files
    If file.Type = "Microsoft Excel Worksheet" Then
    cboSFile.AddItem file.Name
    End If
    Next file
    End If

    Set FSO3 = Nothing
    End Sub
    --
    Tyrell Fickenscher
    Plant Manager / Agronomist

  2. #2
    Tom Ogilvy
    Guest

    Re: Populating Combo Boxes Still Not Working

    Which one isn't working?
    What is the error.

    Which line is highlighted.

    --
    Regards,
    Tom Ogilvy


    "Tyrell" <[email protected]> wrote in message
    news:[email protected]...
    > For some reason I still cannot get the combo boxes to populate using the

    code
    > below. Does anyone have any other recommendations on how I could get this

    to
    > work? Thank you to the gentleman who helped me earlier with this but it's
    > still not working. Any help would be greatly appreciated !
    >
    >
    > Private Sub Populate_cboSOperations()
    >
    > 'Populate Combo Box cboSOperations
    >
    > Dim FSO As Object
    > Dim sFolder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker"
    >
    > If Folder <> "" Then
    > Set sFolder = FSO.GetFolder(Folder)
    > Set Files = sFolder.SubFolders
    > cboSOperation.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSOperation.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO = Nothing
    > End Sub
    >
    > Private Sub cboSOperation_Change()
    >
    > 'Populate Combo Box cboSGrower
    >
    > Dim FSO1 As Object
    > Dim s1Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO1 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"
    >
    > If cboSOperation.Value <> "" Then
    > Set s1Folder = FSO1.GetFolder(Folder)
    > Set Files = s1Folder.SubFolders
    > cboSGrower.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSGrower.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO1 = Nothing
    > End Sub
    >
    > Private Sub cboSGrower_Change()
    >
    > 'Populate Combo Box cboSYear
    >
    > Dim FSO2 As Object
    > Dim s2Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO2 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > Trim(cboSGrower.Value) & "\"
    >
    > If cboSGrower.Value <> "" Then
    > Set s2Folder = FSO2.GetFolder(Folder)
    > Set Files = s2Folder.SubFolders
    > cboSYear.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSYear.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO2 = Nothing
    > End Sub
    >
    > Private Sub cboSYear_Change()
    >
    > 'Populate Combo Box cboSFile
    >
    > Dim FSO3 As Object
    > Dim s3Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO3 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"
    >
    > If cboSYear.Value <> "" Then
    > Set s3Folder = FSO3.GetFolder(Folder)
    > Set Files = s3Folder.SubFolders
    > cboSFile.Clear
    > For Each file In Files
    > If file.Type = "Microsoft Excel Worksheet" Then
    > cboSFile.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO3 = Nothing
    > End Sub
    > --
    > Tyrell Fickenscher
    > Plant Manager / Agronomist




  3. #3
    Norman Jones
    Guest

    Re: Populating Combo Boxes Still Not Working

    Hi Tyrell,

    You appear to confuse the Folder and sFolder variables.

    Try replacing your first sub with:

    '===========>>
    Private Sub Populate_cboSOperations()

    'Populate Combo Box cboSOperations

    Dim FSO As Object
    Dim sFolder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object

    Set FSO = CreateObject("Scripting.FileSystemObject")

    sFolder = "C:\Ag Valley\Tracker"

    If sFolder <> "" Then
    Set Folder = FSO.GetFolder(sFolder)
    Set Files = Folder.SubFolders
    cboSOperation.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSOperation.AddItem file.Name
    End If
    Next file
    End If

    Set FSO = Nothing
    End Sub

    '<<========

    Make analogous amendments to the other procedures.



    ---
    Regards,
    Norman



    "Tyrell" <[email protected]> wrote in message
    news:[email protected]...
    > For some reason I still cannot get the combo boxes to populate using the
    > code
    > below. Does anyone have any other recommendations on how I could get this
    > to
    > work? Thank you to the gentleman who helped me earlier with this but it's
    > still not working. Any help would be greatly appreciated !
    >
    >
    > Private Sub Populate_cboSOperations()
    >
    > 'Populate Combo Box cboSOperations
    >
    > Dim FSO As Object
    > Dim sFolder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker"
    >
    > If Folder <> "" Then
    > Set sFolder = FSO.GetFolder(Folder)
    > Set Files = sFolder.SubFolders
    > cboSOperation.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSOperation.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO = Nothing
    > End Sub
    >
    > Private Sub cboSOperation_Change()
    >
    > 'Populate Combo Box cboSGrower
    >
    > Dim FSO1 As Object
    > Dim s1Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO1 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"
    >
    > If cboSOperation.Value <> "" Then
    > Set s1Folder = FSO1.GetFolder(Folder)
    > Set Files = s1Folder.SubFolders
    > cboSGrower.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSGrower.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO1 = Nothing
    > End Sub
    >
    > Private Sub cboSGrower_Change()
    >
    > 'Populate Combo Box cboSYear
    >
    > Dim FSO2 As Object
    > Dim s2Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO2 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > Trim(cboSGrower.Value) & "\"
    >
    > If cboSGrower.Value <> "" Then
    > Set s2Folder = FSO2.GetFolder(Folder)
    > Set Files = s2Folder.SubFolders
    > cboSYear.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSYear.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO2 = Nothing
    > End Sub
    >
    > Private Sub cboSYear_Change()
    >
    > 'Populate Combo Box cboSFile
    >
    > Dim FSO3 As Object
    > Dim s3Folder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    > 'Dim This As Object
    >
    > Set FSO3 = CreateObject("Scripting.FileSystemObject")
    > Set This = ActiveWorkbook
    > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"
    >
    > If cboSYear.Value <> "" Then
    > Set s3Folder = FSO3.GetFolder(Folder)
    > Set Files = s3Folder.SubFolders
    > cboSFile.Clear
    > For Each file In Files
    > If file.Type = "Microsoft Excel Worksheet" Then
    > cboSFile.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO3 = Nothing
    > End Sub
    > --
    > Tyrell Fickenscher
    > Plant Manager / Agronomist




  4. #4
    Tyrell
    Guest

    Re: Populating Combo Boxes Still Not Working

    Tom,
    The combo box simply would not fill. But it appears it was a mistake I made
    when I used your recommended code. I can fill the first combo box but the
    second combo box will not fill based on what is selected in the first. Any
    recommendations?
    Regards,


    Private Sub Populate_cboSOperations()

    'Populate Combo Box cboSOperations

    Dim FSO As Object
    Dim sFolder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object

    Set FSO = CreateObject("Scripting.FileSystemObject")
    sFolder = "C:\Ag Valley\Tracker"

    If sFolder <> "" Then
    Set Folder = FSO.GetFolder(sFolder)
    Set Files = Folder.SubFolders
    cboSOperation.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSOperation.AddItem file.Name
    End If
    Next file
    End If

    Set FSO = Nothing
    End Sub


    Private Sub cboSOperation_Change()

    Dim FSO As Object
    Dim sFolder As String
    Dim Folder As Object
    Dim file As Object
    Dim Files As Object

    Set FSO = CreateObject("Scripting.FileSystemObject")
    sFolder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"

    'If cboSOperation.Value <> "" Then
    If sFolder <> "" Then
    Set Folder = FSO.GetFolder(sFolder)
    Set Files = Folder.SubFolders
    cboSGrower.Clear
    For Each file In Files
    If file.Type = "File Folder" Then
    cboSGrower.AddItem file.Name
    End If
    Next file
    End If

    Set FSO = Nothing
    End Sub
    --
    Tyrell Fickenscher
    Plant Manager / Agronomist


    "Tom Ogilvy" wrote:

    > Which one isn't working?
    > What is the error.
    >
    > Which line is highlighted.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Tyrell" <[email protected]> wrote in message
    > news:[email protected]...
    > > For some reason I still cannot get the combo boxes to populate using the

    > code
    > > below. Does anyone have any other recommendations on how I could get this

    > to
    > > work? Thank you to the gentleman who helped me earlier with this but it's
    > > still not working. Any help would be greatly appreciated !
    > >
    > >
    > > Private Sub Populate_cboSOperations()
    > >
    > > 'Populate Combo Box cboSOperations
    > >
    > > Dim FSO As Object
    > > Dim sFolder As String
    > > Dim Folder As Object
    > > Dim file As Object
    > > Dim Files As Object
    > > 'Dim This As Object
    > >
    > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > Set This = ActiveWorkbook
    > > Folder = "C:\Ag Valley\Tracker"
    > >
    > > If Folder <> "" Then
    > > Set sFolder = FSO.GetFolder(Folder)
    > > Set Files = sFolder.SubFolders
    > > cboSOperation.Clear
    > > For Each file In Files
    > > If file.Type = "File Folder" Then
    > > cboSOperation.AddItem file.Name
    > > End If
    > > Next file
    > > End If
    > >
    > > Set FSO = Nothing
    > > End Sub
    > >
    > > Private Sub cboSOperation_Change()
    > >
    > > 'Populate Combo Box cboSGrower
    > >
    > > Dim FSO1 As Object
    > > Dim s1Folder As String
    > > Dim Folder As Object
    > > Dim file As Object
    > > Dim Files As Object
    > > 'Dim This As Object
    > >
    > > Set FSO1 = CreateObject("Scripting.FileSystemObject")
    > > Set This = ActiveWorkbook
    > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"
    > >
    > > If cboSOperation.Value <> "" Then
    > > Set s1Folder = FSO1.GetFolder(Folder)
    > > Set Files = s1Folder.SubFolders
    > > cboSGrower.Clear
    > > For Each file In Files
    > > If file.Type = "File Folder" Then
    > > cboSGrower.AddItem file.Name
    > > End If
    > > Next file
    > > End If
    > >
    > > Set FSO1 = Nothing
    > > End Sub
    > >
    > > Private Sub cboSGrower_Change()
    > >
    > > 'Populate Combo Box cboSYear
    > >
    > > Dim FSO2 As Object
    > > Dim s2Folder As String
    > > Dim Folder As Object
    > > Dim file As Object
    > > Dim Files As Object
    > > 'Dim This As Object
    > >
    > > Set FSO2 = CreateObject("Scripting.FileSystemObject")
    > > Set This = ActiveWorkbook
    > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > > Trim(cboSGrower.Value) & "\"
    > >
    > > If cboSGrower.Value <> "" Then
    > > Set s2Folder = FSO2.GetFolder(Folder)
    > > Set Files = s2Folder.SubFolders
    > > cboSYear.Clear
    > > For Each file In Files
    > > If file.Type = "File Folder" Then
    > > cboSYear.AddItem file.Name
    > > End If
    > > Next file
    > > End If
    > >
    > > Set FSO2 = Nothing
    > > End Sub
    > >
    > > Private Sub cboSYear_Change()
    > >
    > > 'Populate Combo Box cboSFile
    > >
    > > Dim FSO3 As Object
    > > Dim s3Folder As String
    > > Dim Folder As Object
    > > Dim file As Object
    > > Dim Files As Object
    > > 'Dim This As Object
    > >
    > > Set FSO3 = CreateObject("Scripting.FileSystemObject")
    > > Set This = ActiveWorkbook
    > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\" &
    > > Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"
    > >
    > > If cboSYear.Value <> "" Then
    > > Set s3Folder = FSO3.GetFolder(Folder)
    > > Set Files = s3Folder.SubFolders
    > > cboSFile.Clear
    > > For Each file In Files
    > > If file.Type = "Microsoft Excel Worksheet" Then
    > > cboSFile.AddItem file.Name
    > > End If
    > > Next file
    > > End If
    > >
    > > Set FSO3 = Nothing
    > > End Sub
    > > --
    > > Tyrell Fickenscher
    > > Plant Manager / Agronomist

    >
    >
    >


  5. #5
    kounoike
    Guest

    Re: Populating Combo Boxes Still Not Working

    Though I don't know how you make comboboxes, my guess about why second
    combo box is not filled is cboSOperation_Change would be not fired.
    because if it was fired, Sub cboSOperation_Change would end up with
    error at Set Folder = FSO.GetFolder(sFolder) in my thought.
    i think Trim(cboSOperation.Value) is just folder name without path
    separator, so sFolder = "C:\Ag Valley\Tracker" &
    Trim(cboSOperation.Value) & "\" would be wrong path.

    keizi

    "Tyrell" <[email protected]> wrote in message
    news:[email protected]...
    > Tom,
    > The combo box simply would not fill. But it appears it was a mistake

    I made
    > when I used your recommended code. I can fill the first combo box but

    the
    > second combo box will not fill based on what is selected in the first.

    Any
    > recommendations?
    > Regards,
    >
    >
    > Private Sub Populate_cboSOperations()
    >
    > 'Populate Combo Box cboSOperations
    >
    > Dim FSO As Object
    > Dim sFolder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    >
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > sFolder = "C:\Ag Valley\Tracker"
    >
    > If sFolder <> "" Then
    > Set Folder = FSO.GetFolder(sFolder)
    > Set Files = Folder.SubFolders
    > cboSOperation.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSOperation.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO = Nothing
    > End Sub
    >
    >
    > Private Sub cboSOperation_Change()
    >
    > Dim FSO As Object
    > Dim sFolder As String
    > Dim Folder As Object
    > Dim file As Object
    > Dim Files As Object
    >
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > sFolder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) & "\"
    >
    > 'If cboSOperation.Value <> "" Then
    > If sFolder <> "" Then
    > Set Folder = FSO.GetFolder(sFolder)
    > Set Files = Folder.SubFolders
    > cboSGrower.Clear
    > For Each file In Files
    > If file.Type = "File Folder" Then
    > cboSGrower.AddItem file.Name
    > End If
    > Next file
    > End If
    >
    > Set FSO = Nothing
    > End Sub
    > --
    > Tyrell Fickenscher
    > Plant Manager / Agronomist
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > Which one isn't working?
    > > What is the error.
    > >
    > > Which line is highlighted.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Tyrell" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > For some reason I still cannot get the combo boxes to populate

    using the
    > > code
    > > > below. Does anyone have any other recommendations on how I could

    get this
    > > to
    > > > work? Thank you to the gentleman who helped me earlier with this

    but it's
    > > > still not working. Any help would be greatly appreciated !
    > > >
    > > >
    > > > Private Sub Populate_cboSOperations()
    > > >
    > > > 'Populate Combo Box cboSOperations
    > > >
    > > > Dim FSO As Object
    > > > Dim sFolder As String
    > > > Dim Folder As Object
    > > > Dim file As Object
    > > > Dim Files As Object
    > > > 'Dim This As Object
    > > >
    > > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > > Set This = ActiveWorkbook
    > > > Folder = "C:\Ag Valley\Tracker"
    > > >
    > > > If Folder <> "" Then
    > > > Set sFolder = FSO.GetFolder(Folder)
    > > > Set Files = sFolder.SubFolders
    > > > cboSOperation.Clear
    > > > For Each file In Files
    > > > If file.Type = "File Folder" Then
    > > > cboSOperation.AddItem file.Name
    > > > End If
    > > > Next file
    > > > End If
    > > >
    > > > Set FSO = Nothing
    > > > End Sub
    > > >
    > > > Private Sub cboSOperation_Change()
    > > >
    > > > 'Populate Combo Box cboSGrower
    > > >
    > > > Dim FSO1 As Object
    > > > Dim s1Folder As String
    > > > Dim Folder As Object
    > > > Dim file As Object
    > > > Dim Files As Object
    > > > 'Dim This As Object
    > > >
    > > > Set FSO1 = CreateObject("Scripting.FileSystemObject")
    > > > Set This = ActiveWorkbook
    > > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) &

    "\"
    > > >
    > > > If cboSOperation.Value <> "" Then
    > > > Set s1Folder = FSO1.GetFolder(Folder)
    > > > Set Files = s1Folder.SubFolders
    > > > cboSGrower.Clear
    > > > For Each file In Files
    > > > If file.Type = "File Folder" Then
    > > > cboSGrower.AddItem file.Name
    > > > End If
    > > > Next file
    > > > End If
    > > >
    > > > Set FSO1 = Nothing
    > > > End Sub
    > > >
    > > > Private Sub cboSGrower_Change()
    > > >
    > > > 'Populate Combo Box cboSYear
    > > >
    > > > Dim FSO2 As Object
    > > > Dim s2Folder As String
    > > > Dim Folder As Object
    > > > Dim file As Object
    > > > Dim Files As Object
    > > > 'Dim This As Object
    > > >
    > > > Set FSO2 = CreateObject("Scripting.FileSystemObject")
    > > > Set This = ActiveWorkbook
    > > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) &

    "\" &
    > > > Trim(cboSGrower.Value) & "\"
    > > >
    > > > If cboSGrower.Value <> "" Then
    > > > Set s2Folder = FSO2.GetFolder(Folder)
    > > > Set Files = s2Folder.SubFolders
    > > > cboSYear.Clear
    > > > For Each file In Files
    > > > If file.Type = "File Folder" Then
    > > > cboSYear.AddItem file.Name
    > > > End If
    > > > Next file
    > > > End If
    > > >
    > > > Set FSO2 = Nothing
    > > > End Sub
    > > >
    > > > Private Sub cboSYear_Change()
    > > >
    > > > 'Populate Combo Box cboSFile
    > > >
    > > > Dim FSO3 As Object
    > > > Dim s3Folder As String
    > > > Dim Folder As Object
    > > > Dim file As Object
    > > > Dim Files As Object
    > > > 'Dim This As Object
    > > >
    > > > Set FSO3 = CreateObject("Scripting.FileSystemObject")
    > > > Set This = ActiveWorkbook
    > > > Folder = "C:\Ag Valley\Tracker" & Trim(cboSOperation.Value) &

    "\" &
    > > > Trim(cboSGrower.Value) & "\" & Trim(cboSYear.Value) & "\"
    > > >
    > > > If cboSYear.Value <> "" Then
    > > > Set s3Folder = FSO3.GetFolder(Folder)
    > > > Set Files = s3Folder.SubFolders
    > > > cboSFile.Clear
    > > > For Each file In Files
    > > > If file.Type = "Microsoft Excel Worksheet" Then
    > > > cboSFile.AddItem file.Name
    > > > End If
    > > > Next file
    > > > End If
    > > >
    > > > Set FSO3 = Nothing
    > > > End Sub
    > > > --
    > > > Tyrell Fickenscher
    > > > Plant Manager / Agronomist

    > >
    > >
    > >



+ Reply to Thread

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