+ Reply to Thread
Results 1 to 5 of 5

Assigning a Sub Routine to an ActiveX control in worksheet?

Hybrid View

danny2000 Assigning a Sub Routine to an... 12-04-2022, 07:39 PM
Croweater Re: Assigning a Sub Routine... 12-04-2022, 07:47 PM
danny2000 Re: Assigning a Sub Routine... 12-04-2022, 08:09 PM
skywriter Re: Assigning a Sub Routine... 12-04-2022, 08:11 PM
danny2000 Re: Assigning a Sub Routine... 12-04-2022, 08:12 PM
  1. #1
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Assigning a Sub Routine to an ActiveX control in worksheet?

    Well I used to be good at all this but for some reason I can't seem to get my ActiveX Command Button control on my worksheet to see the Sub Routine I assigned to it.

    When I click on the button, I just get 'Sub or Function not defined'.

    I've clearly forgotten something here. Where am I going wrong?
    Last edited by danny2000; 12-04-2022 at 08:17 PM.
    If this has helped you please set this question to 'SOLVED'.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Assigning a Sub Routine to an ActiveX control in worksheet?

    Could be a number of reasons. Put up your worksheet, that might be a good start.

  3. #3
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Assigning a Sub Routine to an ActiveX control in worksheet?

    Quote Originally Posted by Croweater View Post
    Could be a number of reasons. Put up your worksheet, that might be a good start.
    I can't do that. There are reasons.
    The ActiveX control seems to be the problem. The normal excel worksheet controls work fine in this regard.

    You say there's a number of reasons. Are you able to suggest a few?

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Assigning a Sub Routine to an ActiveX control in worksheet?

    With an activex command button you would click the developer tab choose to go into design mode, right click on the command button, choose view code on the popup menu and call the routine you wish to use from within the command button click code.
    Is that what you did?

  5. #5
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Assigning a Sub Routine to an ActiveX control in worksheet?

    Quote Originally Posted by skywriter View Post
    With an activex command button you would click the developer tab choose to go into design mode, right click on the command button, choose view code on the popup menu and call the routine you wish to use from within the command button click code.
    Is that what you did?
    Yes, that's what I did.. Done it thousands of times, but for some reason it's now not seeing my sub routine.
    I have to paste the contents of that sub routine directly into the Command Button click event procedure.

    ------------------------------------------------------------------Update.
    Actually, I just solved it.
    I write the macro into the worksheet module instead of opening a new module and putting my code in that.

    Rooky Error it seems!
    Last edited by danny2000; 12-04-2022 at 08:16 PM.

+ 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. Replies: 2
    Last Post: 11-20-2017, 12:13 PM
  2. Problems printing worksheet with list box (activex control)
    By Ozedad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2017, 03:36 AM
  3. can you Embed ActiveX control (Calendar Date Picker) into worksheet?
    By cs454 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2014, 01:24 PM
  4. [SOLVED] ActiveX Control Button in Protected Worksheet - Excel 2010
    By cblp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2014, 11:48 PM
  5. Add buttons in temp worksheet though VBA (not activeX control)
    By dinosaur1993 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2013, 04:52 AM
  6. Assigning Macros to Macro created ActiveX Control Box
    By sm9748 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-18-2013, 02:02 PM
  7. Reference to ActiveX control on worksheet requires full worksheet name
    By Ian Ripsher in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2005, 12:05 PM

Tags for this Thread

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