Private Sub fruitList_Click() End Sub Private Sub UserForm_Initialize() With fruitList .AddItem "BANANA" .AddItem "APPLE" .AddItem "ORANGE" .AddItem "PINEAPPLE" End With End Sub wb1.Activate 'Dim xlApp As Excel.Application 'ReadOnly fruitdata16 'Set xlApp = CreateObject("Excel.Application") 'xlApp.Visible = True 'xlApp.Workbooks.Open fileName:=fruitdata16 'Identify fruit Workbook name' 'MsgBox ActiveWorkbook.name, vbInformation, "Workbook Name" bprWb = ActiveWindow.Caption Sheets("NA Fruit Data").Select fruitChosen = fruitList.Value lastrowFinal = ActiveSheet.Cells(Rows.count, "A").End(xlUp).row 'MsgBox lastrowFinalWB3 wb1.Activate If fruitChosen = "APPLE" Then FilterAPPLE lastrowFinal, wb1 ElseIf fruitChosen = "BANANA" Then FilterBAN lastrowFinal, wb1 ElseIf fruitChosen = "ORANGE" Then FilterORANGE lastrowFinal, wb1 ElseIf fruitChosen = "PINEAPPLE" Then FilterPA lastrowFinal, wb1 Else [B] MsgBox "Please choose your fruit"[/B] End End If
Above is the code used to choose the user's fruit of choice (changed to fruit for confidentiality). Basically, this userform will list all fruit and the user selects one. This works in MS 2010 package. Our company is rolling out updates to MS 2016 and now the macro will consistently produce a message box saying "Please choose your fruit" i.e. not registering the userform selection.
I was able to see on a computer it wasn't working, it references a MS Object Library 16.0 and I'm currently running 14.0 (macro still works for me).
I have tried clearing *.exd files from his C drive, but it still did not help.
Any ideas? Thanks in advance.
Last edited by a moderator: