+ Reply to Thread
Results 1 to 3 of 3

Assigning Onaction to control in a new workbook

  1. #1
    Registered User
    Join Date
    08-07-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    1

    Assigning Onaction to control in a new workbook

    All,

    I have a program that creates a report in a new workbook. I add checkbox controls to the report via vba and assign what subs should run when clicked. I'm running into a problem where it is assigning the control to the workbook running the code and not the new workbook. I've tried to add the full filename of the workbook along with the sub and this didn't seem to help. Anyone have any ideas what i'm doing wrong? Your help is greatly appreciated.

    Thanks!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Assigning Onaction to control in a new workbook

    Currently, it sounds like this is all done in the MasterWorkbook

    make NewBook
    write code to NewBook
    make checkboxes in NewBook
    assign checkboxes to new code

    What you might do, is

    make NewBook
    write code to NewBook
    write create-checkbox-code to NewBook (including macro assignments)
    call newBook's create-checkbox-code
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Assigning Onaction to control in a new workbook

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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