VBA-tools / VBA-Dictionary

Drop-in replacement for Scripting.Dictionary on Mac
MIT License
358 stars 89 forks source link

Syntax Error in property Get Count() #31

Open 1ericsanchez opened 3 years ago

1ericsanchez commented 3 years ago

Hi, thanks for making this dictionary replacement for VBA. I'm having trouble getting it to work though. Currently I'm getting a syntax error when I try to define a dictionary. No error codes with the syntax error, but it points me to the following lines with the second line (Attribute Count.VB... ) highlighted:

Public Property Get Count() As Long
Attribute Count.VB_Description = "Get the number of items in the dictionary.\n"
#If Mac Or Not UseScriptingDictionaryIfAvailable Then
    Count = dict_pKeyValues.Count
#Else
    Count = dict_pDictionary.Count
#End If
End Property

Is this a known issue or do you have any suggestions on tracing back the issue? I'm using Excel 2016 for mac, OSX 10.15.7

Thanks!

Edit: code block formatting

pietermj commented 3 years ago

Hi, that seems to be an artefact from (mis-)importing the module. When importing, the Attribute (propertyname).VB_Description directive is used to assign a description to the count property, which then could be viewed in the object browser in the VBA IDE. Simply delete it or comment it to debug.