VBA compiler compiling errors

PhuongM

New member
I got a compiling error with the following code:

Dim XS2RunList() as long

How can I get the VBA Compiler work with dynamic array?

I also got compiling error with other misc. constants ie vbYesNo, vbCrLf, xlNone, xlContinuous, xlInterrupt,xlErrorHandler

How can I get around them?
 
Dynamic arrays use a different convention. Here is a basic sample:
Code:
Sub MyProtectedSub(Param1)

' Create a dynamic array
DIM PTIM = VarArrayCreate([0,3000,0,5], 12)

' Assign a value:
PTIM[1,2] = 1530

'Show the value:
MsgBox (PTIM[1,2])
End Sub
For the unknown constants, we’re checking why they are not recognized.
 
Last edited:
Back
Top