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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,882
Messages
6,175,165
Members
452,615
Latest member
bogeys2birdies

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