Enum in VBA

Enum in VBA

Anonymous
Not applicable
561 Views
5 Replies
Message 1 of 6

Enum in VBA

Anonymous
Not applicable
R14.01 / VBA / W98

Hi,

I'm playing with Frank Oquendo's Filedialog Class.
I've pasted the code in the R14.01 VBA editor, but the 'ENUM' command is not
recognized. Also, in the VBA Help I can't find anything about ENUM.

Any hints in the right direction?

TIA

Arno van Eeuwen
0 Likes
562 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Try looking in VB6 ....

General Purpose Enumerations
The members of an enumeration need not be sequential or contiguous. Thus, if
you have some general-purpose numeric constants you wish to define for your
component, you can put them into a catch-all Enum.

Public Enum General
levsFeetInAMile = 5280
levsIgnitionTemp = 451
levsAnswer = 42
End Enum



"A van Eeuwen" wrote in message
news:DE3D911311201F44FF0D929801D4EE7E@in.WebX.maYIadrTaRb...
> R14.01 / VBA / W98
>
> Hi,
>
> I'm playing with Frank Oquendo's Filedialog Class.
> I've pasted the code in the R14.01 VBA editor, but the 'ENUM' command is
not
> recognized. Also, in the VBA Help I can't find anything about ENUM.
>
> Any hints in the right direction?
>
> TIA
>
> Arno van Eeuwen
>
>
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
R14 uses VBA 5. Enum may not have been available in VB5, but I was thinking
it was.

To work around it, drop the enum and end enum lines and change any
functions that take
that enum type as arguments to use integers instead.

ie:

From:

public enum MyEnum
meOption1=1
meOption2=2
meOption3=4
end enum

public function MyFunction(Arg1 as MyEnum)
'...
End Function

To:

'Delete this line- public enum MyEnum
meOption1=1
meOption2=2
meOption3=4
'Delete this line- end enum

public function MyFunction(Arg1 as INTEGER)
'...
End Function

Brian D.


"A van Eeuwen" wrote in message
news:DE3D911311201F44FF0D929801D4EE7E@in.WebX.maYIadrTaRb...
> R14.01 / VBA / W98
>
> Hi,
>
> I'm playing with Frank Oquendo's Filedialog Class.
> I've pasted the code in the R14.01 VBA editor, but the 'ENUM' command is
not
> recognized. Also, in the VBA Help I can't find anything about ENUM.
>
> Any hints in the right direction?
>
> TIA
>
> Arno van Eeuwen
>
>
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Thanks Brian,

I was thinking of a simmilar solution, but I'm a bit puzzled that ENUM doesn't work. I haven't used ENUM frequently, but I surely have seen it in VB5.
As Gadtec wrote, yes in VB6 it's available too, but I'm trying a quicky in VBA, which seems to become not as quick as I expected. 😉
Thanks for the support.

Arno
0 Likes
Message 5 of 6

Anonymous
Not applicable
While VB5 supports enums, VBA5 does not.

--
Learn to think outside the book.

http://www.acadx.com


"avaneeuwen" wrote in message
news:f0c85ce.2@WebX.maYIadrTaRb...
Thanks Brian,
I was thinking of a simmilar solution, but I'm a bit puzzled that ENUM
doesn't work. I haven't used ENUM frequently, but I surely have seen it in
VB5.
As Gadtec wrote, yes in VB6 it's available too, but I'm trying a quicky in
VBA, which seems to become not as quick as I expected. 😉
Thanks for the support.
Arno
0 Likes
Message 6 of 6

Anonymous
Not applicable
Cheers,
Arno
0 Likes