VBA-tools / VBA-Dictionary

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

Not working for Excel 2021 #38

Open dreamflasher opened 1 year ago

dreamflasher commented 1 year ago

I've tried several things, and I get various error messages.

1) Import the cls file results in: It's imported under modules. Using it gives Compile error: Expected: end of statement at VERSION 1.0 CLASS removing that results in: Compile error: Invalid outside procedure at BEGIN removing that block results in: Compile error: A module is not a valid type at my code Dim dict As New Dictionary

2) Create a new class module by right click the project (root), then Insert -> Class Module, copy the code of Dictionary.cls in there, rename the class module to Dictionary results in: Compile error: Expected: end of statement at VERSION 1.0 CLASS removing that results in: Compile error: Invalid outside procedure at BEGIN removing that block results in: Compile error: Syntax error at Attribute VB_Name = "Dictionary" removing that block results in Run-time error 438: Object doesn't support this property or method at my code dict("a") = "b"

3) Run VBA-Dictionary - Specs.xlsm results in: Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute.

DecimalTurn commented 1 year ago

In your first method, how did you download the code? If you downloaded it using the .zip download option and you unzip it, it should work: https://github.com/VBA-tools/VBA-Dictionary/releases

There is a problem with the download raw file option because it will not convert Unix-style line-endings (LF) to Windows-style line endings (CRLF) and the VBE expects files to use CRLF.

image

ethan-massey commented 1 year ago

Thank you! I had this same issue when using the download raw file option. The .zip download option worked!

cristianbuse commented 5 months ago

This repository does not seem to be maintained. Alternatively use VBA-FastDictionary which is well tested and faster