Arrays

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,600
Office Version
  1. 365
Platform
  1. Windows
I built a project in 2019 which uses a specific line of code to create an object to allow the use of arrays
VBA Code:
Set ObjForSList = CreateObject("system.collections.arraylist")
This project no longer works and debugs on the above code.

Looking at some references around VBA defined arrays, it seems that if the .Net Framework version is not v3.5 then it won't work. This includes later than v3.5 as well!

Is there a way of working with arrays in a way that isn't restricted by the .NET Framework version?


TIA
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Arrays and the arraylist are not the same thing. What are you using the arraylist for - sorting?
 
Upvote 0
Arrays and the arraylist are not the same thing. What are you using the arraylist for - sorting?
Yes, the original code sorted the array once established.

I am thinking just to dump the array values into a holding sheet via a for loop and then sortring rather than making it too complicated.....
 
Upvote 0
There are lots of VB/VBA methods for sorting arrays in memory (eg bubble sort / quick sort) and numerous examples of code around... ;)
 
Upvote 0
Thanks for the tip.

I'll have a dig around and get somethign working!
 
Upvote 0

Forum statistics

Threads
1,215,126
Messages
6,123,200
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top