Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Another stupid newbie question.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Another stupid newbie question.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Another stupid newbie question.


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
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
big stupid question Wu Excel Discussion (Misc queries) 4 May 17th 08 05:33 PM
stupid question Kimberly New Users to Excel 4 May 18th 07 08:55 PM
Stupid Question mastermind Excel Worksheet Functions 1 August 5th 06 07:03 PM
Stupid question from newbie data from multicolumn combobox mato nanjin Excel Programming 3 June 12th 06 09:31 PM
Stupid, stupid question.... DS Excel Programming 3 September 25th 05 03:51 PM


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

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

About Us

"It's about Microsoft Excel"