Reputation: 103
I have a project that looks something like this:
Function boi(sheet As Worksheet) As Scripting.Dictionary
Set my = New Scripting.Dictionary
'actually some stuff with the sheet
my.Add Key:="Foo", Item:="Bar"
boi = my
End Function
Sub test()
Dim tsheet As Worksheet
Set tsheet = Sheets("INPUT_OLD_DATA")
MsgBox (boi(tsheet)("Foo"))
When I try to run test(), it gives me a Compile error Argument not optional on the line boi = my
. What I dont understand ist how there can be an Argument not optional error on a line where no function is called. As it doesn't actually get to the line boi = my
I also don't think the error can be due to an invalid return.
I come from Python/Javascript/Java, please pardon me if this is an extremely noob question. :)
Upvotes: 0
Views: 201