Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Jamie Collins" skrev i melding
oups.com... As far as I know there is no good reason for using a Public variable; I've never used one myself. If you need to share a module-level variable with another module, you can use a Property Hi Jamie Question of style, I think. I use public variables for things that are used all over the app and that won't change "today" (=during the session). Typically it's a username, a database address, environmental information, a major choice in startup, ... Best wishes Harald |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Harald Staff wrote: I use public variables for things that are used all over the app and that won't change "today" (=during the session). Typically it's a username, a database address, environmental information, a major choice in startup, ... I can see a justification in these cases because they are genuinely global to the project/session in question. Such measured thought is not always present. I was recently tempted in an Excel project to use a Public variable named IsDirty but when I stopped to think about it, I concluded it was specifically the *workbook* I was flagging as dirty, therefore I ended up creating a Friend Property in the ThisWorkbook code module. Question of style, I think. At the level being discussed here, definitely. To use all Public variables declared as Variant may be a 'dubious' style <g. Jamie. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public Variables | Excel Discussion (Misc queries) | |||
Public Password | Excel Discussion (Misc queries) | |||
Public Function | Excel Discussion (Misc queries) | |||
public sub | Excel Programming | |||
Public Sub Help | Excel Programming |