We help IT Professionals succeed at work.

Bug in VBA : Error 13

97 Views
Last Modified: 2018-10-09
Hello everyone,

I am blocked. When i unload the Userform3 "New product" and i select the company in option button it goes to error.

Can you help to solve my problem

Thank you
Comment
Watch Question

gowflowPartner
CERTIFIED EXPERT

Commented:
I guess you need to post a sample workbook that show the error so we can help you.
gowflow
Roy CoxGroup Finance Manager
CERTIFIED EXPERT

Commented:
What error message are you getting? An example workbook would definitely help.

Where is the Option Button?
Fabrice LambertConsulting
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Hi,

Error 13 is a type uncompatibility error.
Alas, without your source code, there is nothing we can do.

Author

Commented:
Good afternoon, I attached the file so you can download it

Thank you
Martin LissProtect yourself and your loved ones. Stay home for the holidays.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Still no attachment. Did you click the blue 'Upload' button?

Author

Commented:
Sorry,

This is the file thank you. Please let me know if it is attached or not
Draft.xlsm
Martin LissProtect yourself and your loved ones. Stay home for the holidays.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I believe the problem is in this code in Userform3. At line 10, 'd' is empty.

Private Sub UserForm_Initialize()
Dim D1 As Object, D2 As Object, D3 As Object, D4 As Object
Stop
Set OI = Worksheets("Items")

TV = OI.Range("X1").CurrentRegion
Set D1 = CreateObject("Scripting.Dictionary")

NL = UBound(TV, 1)
Set d = CreateObject("Scripting.Dictionary")
For i = 2 To NL
    D1(TV(i, 1)) = ""
    
Next i
Me.ComboBox4.List = D1.keys
Me.ComboBox4.SetFocus
End Sub

Open in new window

Grand Poobah
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2011
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thank you all For your help and solutions.

Author

Commented:
I have another problem in the same file should i continue here or create another Question?

Thank you
Roy CoxGroup Finance Manager
CERTIFIED EXPERT

Commented:
Start a separate question please