Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Enum Members Declaration

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.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Enum Members Declaration

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.


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



"Ronald Dodge" wrote in message
...
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.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Enum Members Declaration

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.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Chip Pearson" wrote in message
...
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.


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



"Ronald Dodge" wrote in message
...
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.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enum Names Goofy Excel Programming 6 November 1st 06 11:29 AM
Excel 97 Enum Larry Dodd[_2_] Excel Programming 5 April 11th 05 11:15 AM
Enum Daniel[_4_] Excel Programming 3 December 22nd 03 12:30 AM
Enum in Excel 97 Chip Pearson Excel Programming 0 September 26th 03 10:03 PM


All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"