Consulting

Results 1 to 7 of 7

Thread: open multiple workbooks and enable macros, then close

  1. #1
    VBAX Contributor
    Joined
    Mar 2009
    Location
    Indiana
    Posts
    113
    Location

    Lightbulb open multiple workbooks and enable macros, then close

    Hello,

    I was wondering if there was a way to enable macros in a workbook(dashboard), and then run a module that opens a number of files (i would need to type in all of the names) and then closes all windows except the dashboard without saving any changes. I have code in multiple workbooks that saves copies after it runs its code. I am trying to do all of this at once. Any help would be appreciated.

    Thanks,
    John

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    When you say enable macro's do you mean with code?

    We certainly can't be helping you do that as that would allow malicious code to be run against someones wishes.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Contributor
    Joined
    Mar 2009
    Location
    Indiana
    Posts
    113
    Location
    haha trust me they want it. The point is to only have to hit enable once. its like a batch job. There are about 50 reports that need to be done

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Still, no.

    They will have to do it manually.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    by the way, you don't have to do this on each workbook.

    Each machine only. If all the reports are on one computer you can just get them to enable macros and then run your code.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You can digitally sign your macros and make them "trusted". See here
    (I need to restore the images)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by lucas
    by the way, you don't have to do this on each workbook.

    Each machine only. If all the reports are on one computer you can just get them to enable macros and then run your code.
    Hi Steve - just to clarify, I would take that to mean each PC. The 'trust level' stays w/the user's settings, so one must talk each user into allowing macros.

Posting Permissions

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