+ Reply to Thread
Results 1 to 5 of 5

Writing Class modules

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2000
    Posts
    31

    Writing Class modules

    Hi everybody,

    I am new to working with class modules. I am unable to make out where I have gone wrong.

    I am getting an error message when writing code in the standard module which will use the classes. The error message is – Compile error. Expected identifier or bracketed expression.

    Also, the intellisense is not working when I type the dot.

    Can someone help me? The relevant xls file is attached

    Thanks in advance,

    Geetha
    Attached Files Attached Files

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Writing Class modules

    Your property Let and Get procedures are mismatched. If you pass a Double to a property Let procedure, then the Get procedure must return a Double. For example, this:
    Please Login or Register  to view this content.
    should be:
    Please Login or Register  to view this content.
    and similarly with your other property procedures.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    01-23-2009
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Writing Class modules

    Hi RS,
    Thanks for the quick response.

    Geetha

  4. #4
    Registered User
    Join Date
    01-23-2009
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Writing Class modules

    Ques 2 . When is a procedure prefixed with public and when not, in a class module ?

    Ques 3. When is it necessary to prefix "Private" in a class module ?

    Geetha
    Last edited by Geetha Gupta; 11-09-2011 at 04:28 AM.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Writing Class modules

    The same rules of scope apply as other modules - they are public by default unless you have an option statement that overrules that.

    By the way, I would suggest you stick with this type of code layout:
    Please Login or Register  to view this content.
    rather than this:
    Please Login or Register  to view this content.
    which serves no purpose other than being harder to read.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1