+ Reply to Thread
Results 1 to 2 of 2

Simple Class Module - Adding commandbuttons at runtime - Will not work

  1. #1
    Registered User
    Join Date
    09-10-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Simple Class Module - Adding commandbuttons at runtime - Will not work

    Hi,

    I am trying to learn class modules and tried the followig to see if I understand how class modules work. The code is supposed to add 2 commandbuttons at runtime. When I run this, the userform loads but the commandbuttons do not...

    Code 1: In a module (Module 1)
    Please Login or Register  to view this content.
    Code2: In the code for the userform(Userform1)
    [Declarations]Dim Buttons() As New clsClicked

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Code3: In the class module (clsClicked)
    [Declarations] Public WithEvents Clicked As CommandButton

    Please Login or Register  to view this content.
    End Sub

    I may have missed a thing or two because I am printing this off th top of my head (I am not using my computer), but you may be able to work out why it does not work. Your help is much appreciated.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Simple Class Module - Adding commandbuttons at runtime - Will not work

    userform code
    Please Login or Register  to view this content.
    module code
    Please Login or Register  to view this content.
    class clsClicked code
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Simple Activesheet.paste will not work (Runtime 1004 error)
    By yjung15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 02:42 PM
  2. How to make a class module work
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2012, 12:05 PM
  3. [SOLVED] ComboBox class .AddItem filled in class module
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2012, 05:48 AM
  4. Replies: 1
    Last Post: 08-30-2011, 02:23 AM
  5. Replies: 4
    Last Post: 02-28-2005, 10:06 AM

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