Argument not optional - Dictionary and Classes

ValentinBIA

New Member
Joined
Oct 1, 2018
Messages
1
Hello everyone! I'm fairly new to VBA, and I'm currently experimenting with Classes and Dictionaries.
However I encountered a problem, that for once, I was not able to solve using the infinite amount of ressources available on the internet.

Whenever I run my macro, I get the "argument not optional" compile error.
It highlights the 4th line of the below code in yellow and the "pParts" on the 5th line in blue.

I think that the error might be due to the fact that contrary to strings or longs, I cannot use Value for a scripting.dictionary. However, I don't know what to use instead.
Does someone know the answer to my question?

Code:
Public Property Get Parts() As Scripting.Dictionary
    Parts = pParts
End Property
Public Property Let Parts(Value As Scripting.Dictionary)
    pParts = Value
End Property

Thank you very much!

Best,

Valentin
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top