Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Enum Members Declaration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ronald Dodge - 14 Nov 2007 18:29 GMT
Would it be wise to use Dim statements to declare the members of an
Enumeration as Long, or would that create issues?

I read in the help files that they are automatically defined as Long data
type, but the one issue I'm having without declaring them first with a Dim
statement is when I put in the name and if the name hasn't been used else
where in the code other than within the Enum block, the capitalization
changes on me, which I use the capitalization to help in catching possible
misspellings.

Signature

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

Chip Pearson - 14 Nov 2007 22:45 GMT
It has been a problem in VBA and VB6 for a very long time that if you type
in the name of an element of an Enum type the declaration within the Enum
takes the capitalization of the entered variable. For example,

Public Enum SomeType
   Val1 = 1
   Val2
   Val3
End Enum

Then type in the following code

Dim TheVar As SomeType
TheVar = val1

The capitalization of Val1 within the Enum is lost. It is a bug, for sure,
but apparently never prioritized enough to be fixed.

Signature

Cordially,
Chip Pearson
Microsoft MVP  - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

> Would it be wise to use Dim statements to declare the members of an
> Enumeration as Long, or would that create issues?
[quoted text clipped - 5 lines]
> changes on me, which I use the capitalization to help in catching possible
> misspellings.
Ronald Dodge - 15 Nov 2007 12:09 GMT
Thank you for the update.  This just means that I have to be extra careful
when using enums, which I'm already finding that I'm having a lot of uses
for Enums with as much as I'm having to modulate with a report program that
I'm currently working on.

Signature

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

> It has been a problem in VBA and VB6 for a very long time that if you type
> in the name of an element of an Enum type the declaration within the Enum
[quoted text clipped - 23 lines]
>> capitalization changes on me, which I use the capitalization to help in
>> catching possible misspellings.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.