Hello.
I have a userform that pops up when you open the file. That userform lets choose the active user, which will fill some cells with the correct file paths from the user computer.
I never had any problem with the userform, but for a colleague of mine it does not show. It is not that it is not working, because if I run through the VBA window, it works fine. The only difference I was able to see is that whenever he opens an excel file, a xlsb pops up. That file is called "Personal" (not named by him), and has others macros stored. Could be the reason of the conflitc but I would appreciate some insight on the matter.
Here is the code of the userform:
To open it I simply have:
Thank you for your help.
I have a userform that pops up when you open the file. That userform lets choose the active user, which will fill some cells with the correct file paths from the user computer.
I never had any problem with the userform, but for a colleague of mine it does not show. It is not that it is not working, because if I run through the VBA window, it works fine. The only difference I was able to see is that whenever he opens an excel file, a xlsb pops up. That file is called "Personal" (not named by him), and has others macros stored. Could be the reason of the conflitc but I would appreciate some insight on the matter.
Here is the code of the userform:
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
End If
End Sub
Private Sub UserForm_Initialize()
Dim ws As Worksheet
Set ws = Worksheets("Settings")
Me.ComboBoxUser.List = ws.Range(ws.Cells(14, 14), ws.Cells(14, 14).End(xlDown)).Value
End Sub
Private Sub OKbutton_click()
Dim user_range As Range
Dim price_path As Variant
Dim platts_path As Variant
Dim ws As Worksheet
Set ws = Worksheets("Settings")
Set user_range = ws.Range(ws.Cells(14, 14), ws.Cells(ws.Cells(14, 14).End(xlDown).Row, ws.Cells(14, 14).End(xlToRight).Column))
price_path = Application.VLookup(ComboBoxUser.Value, user_range, 2, False)
platts_path = Application.VLookup(ComboBoxUser.Value, user_range, 3, False)
font_letter = Application.VLookup(ComboBoxUser.Value, user_range, 4, False)
font_size = Application.VLookup(ComboBoxUser.Value, user_range, 5, False)
font_color = Application.VLookup(ComboBoxUser.Value, user_range, 6, False)
ws.Cells(7, 15) = price_path
ws.Cells(8, 15) = platts_path
ws.Cells(9, 15) = font_letter
ws.Cells(10, 15) = font_size
ws.Cells(11, 15) = font_color
Unload Me
End Sub
Private Sub Cancelbutton_click()
Unload Me
End Sub
To open it I simply have:
Code:
Private Sub Workbook_Open()
Unload UserForm2
UserForm2.Show
End Sub
Thank you for your help.