Excel 97 Enum
I have a module that accesses the registry. It uses the Enum type and this
works find in Office 2000 but in Office 97 it does not work. I know that VBA
5 does not support the Enum type. I need to know what to use instead of the
Enum type. I have included some code below:
Public Enum RegOptions ' variable: lOptions
StoreNumbersAsStrings = 1
ReturnMultiStringsAsArrays = 2
ExpandEnvironmentStrings = 4
ShowErrorMessages = 8
End Enum
Public Enum RegRoot ' variable: lRoot
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001 ' default
HKEY_LOCAL_MACHINE = &H80000002
End Enum
Property Let Root(lProp As RegRoot)
' Don't accept an invalid Root value.
Select Case lProp
Case HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, _
HKEY_LOCAL_MACHINE
' All is well.
Case Else
lRoot = HKEY_CURRENT_USER
End Select
If lProp < lRoot Then
lRoot = lProp
If Len(strKeyName) Then
GetKeyHandle lRoot, strKeyName
End If
End If
lRoot = lProp
End Property
|