Consulting

Results 1 to 4 of 4

Thread: Solved: run macro from one workbok to affect other workbook

  1. #1
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location

    Solved: run macro from one workbok to affect other workbook

    I have a co-worker that outputs a report daily that needs to modified. I have a master workbook that I automated the formatting and formula inserting task I perform daily. I want to make a menu item he can click to run the macro on his workbook.
    I have the menu part mostly worked out.

    I have 2 dilemma's (delemmie?)

    1. not sure how to tell my workbook macro to run on other workbook.

    2. I can try to copy his worksheet to an import sheet in my workbook and run the macro then output the page with a new name (todays date is how they are named)

    Problem just copying is his worksheet is an outline with 3 levels, (autofilter?) when i copy I loose the levels and my macro debugs.

    I'll attach what I have. My macro works if I have both workbooks open and hit "alt+F8" and chose the top macro from the list.
    It errors when He tries it so I'm trying to make it easier...

    I appreciate any suggestions or full blown code too
    Thanks
    Mark
    Attached Files Attached Files

  2. #2
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    Here is the finished workbook
    and I'll post a pre-edit sample produce too.
    Attached Files Attached Files

  3. #3
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    This is his file. Before Edit
    The finished is 9-26-12 mp.xls after edit
    Attached Files Attached Files

  4. #4
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location

    used open workbook and activate worbooks(2)

    I kept searching knowledge base
    and found an open workbook dialog
    and activate workbooks(2) by index works now.
    I post my result here for posterity

    So my macro prompts user to close all workbooks,
    then has them choose a file top open
    then activates that workbook and runs the macro.

    Yeah.
    Attached Files Attached Files

Posting Permissions

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