Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to dim some variables as public. I have this statement (among
others) in a module in the Auto_Open Sub: "Public dtPropDate As Date ' quote date" I get the following error message when the workbook loads: "Compile error. Invalid atribute in Sub or function" Any ideas why I get this? How can I screw up something this simple? Thanks, Ron |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It sounds as though you have declared it as part of a sub. In a sub it must
be a Dim. Public is used to declare a global variable, but it must be declared outside of, and before, any procedures. -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "mato nanjin" wrote in message ... I am trying to dim some variables as public. I have this statement (among others) in a module in the Auto_Open Sub: "Public dtPropDate As Date ' quote date" I get the following error message when the workbook loads: "Compile error. Invalid atribute in Sub or function" Any ideas why I get this? How can I screw up something this simple? Thanks, Ron |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() mato nanjin I a dumb newbie too but I think I may be smart enough to answer your question. You cant use certain words that are "reserved" like "Public" as a variable. I think the way to write this is: Dim dtPropDate As Date -- light ------------------------------------------------------------------------ light's Profile: http://www.excelforum.com/member.php...fo&userid=7228 View this thread: http://www.excelforum.com/showthread...hreadid=552019 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
big stupid question | Excel Discussion (Misc queries) | |||
stupid question | New Users to Excel | |||
Stupid Question | Excel Worksheet Functions | |||
Stupid question from newbie data from multicolumn combobox | Excel Programming | |||
Stupid, stupid question.... | Excel Programming |