2022-02-16

Tech Programing

程式人小天地

What options do I have to CreateObject(“System.Collections.ArrayList”)?

1 min read


I have a file we share among a lot of people at work. The past five years the code has worked fine, but now a new guy is introduced to the file and he get the (links to other threads about the error) automation error on this part below:

        Dim TillfLevdagar(1 To 14) As String
        .... 
        ' code that sets some of the array items above
        .....


        Dim arr2 As Object

        Set arr2 = CreateObject("System.Collections.ArrayList") ' here it errors
        
        For Each itm In TillfLevdagar
            If itm <> "" Then arr2.Add CInt(itm)
        Next
        arr2.Sort

        For Each itm In arr2
            msg = msg & itm & ","
        Next

Since this is a work computer we are very limited in allowing any software to be installed. That includes Microsoft software.
Becuase of this I ask what alternatives do I have to the code above?



Source link

資料來源:Stackoverflow

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *