0

Trying to create a macro in Excel VBA. Get Run-time error '91': Object variable or With block variable not set

What is wrong here? Isn't that simply supposed to work?

Function comeinand() As Object
    Dim screwaround As Object
    Set screwaround = New Collection
    'Also tried:
    'Dim screwaround As New Collection
    'Set screwaround = CreateObject("System.Collections.ArrayList")
    comeinand = screwaround 
End Function
user2366975
  • 4,350
  • 9
  • 47
  • 87

0 Answers0