Hi,
I am extremely confused why the following works in a normal VBA module:
But the exact same code does NOT work in a custom VBA Class, which has a Variant array as one of its private fields.
In my custom class, I have (outside of any methods) the following array code:
In my class_intialize method, I redim() the array to have 3 elements, as follows:
Then, I have a function that calculates the number of elements in the array arr():
I cannot compile or run any code because I get a Compile Error: Wrong number of arguments or invalid property assignment. The text isEmpty is highlighted.
I know of no other way of truly counting non-empty array elements. Worksheet function CountA counts all (including empty elements) and Worksheet function Count() does NOT count string elements, which is really unfortunate.
Do I need to change how my custom class initializes the array or something? I have spent hours on this and I am completely out of ideas.
Can anyone offer any advice? Thanks!
Bookmarks