+ Reply to Thread
Results 1 to 2 of 2

VBA being written to another work book assigning macro incorrectly

  1. #1
    Registered User
    Join Date
    03-10-2004
    Posts
    45

    VBA being written to another work book assigning macro incorrectly

    I am having a procedure build and write a module into another workbook. The procedure then creates a button in that same workbook and a macro is assigned(the procedure that was built). It does all this but when I use the button it's looking for the assigned macro from the workbook that initially wrote the procedure. How can I get it to call the procedure from within itself. I have the button creation .OnAction = "Button_Click" . Button Click is the Sub that was written by the build and is in the workbook where the button is created.


    VBA provided below:

    Button Creation Procedure:
    Please Login or Register  to view this content.
    VBA that adds module & write sub in module:
    Please Login or Register  to view this content.
    Last edited by Michael Wise; 07-21-2010 at 09:02 AM. Reason: Solved!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: VBA being written to another work book assigning macro incorrectly

    Try including the workbook name:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

+ 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