Avatar of Adil Kh
Adil Kh

asked on 

Bug in VBA : Error 13

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
VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Roy Cox
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

I guess you need to post a sample workbook that show the error so we can help you.
gowflow
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

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

Where is the Option Button?
Hi,

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

ASKER

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

Thank you
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Still no attachment. Did you click the blue 'Upload' button?
Avatar of Adil Kh
Adil Kh

ASKER

Sorry,

This is the file thank you. Please let me know if it is attached or not
Draft.xlsm
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

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

ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Adil Kh
Adil Kh

ASKER

Thank you all For your help and solutions.
Avatar of Adil Kh
Adil Kh

ASKER

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

Thank you
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Start a separate question please
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo