Consulting

Results 1 to 3 of 3

Thread: Running Macros in other Spreadsheets

  1. #1
    VBAX Newbie
    Joined
    Apr 2015
    Posts
    2
    Location

    Running Macros in other Spreadsheets

    Hi,

    I have seversl reports that I need to run every week. They are run from Macros that gather info from several other spreadsheets into a formatted spreadsheet.

    I would like to create a macro in a generic spreadsheet that will run each of the other macros after opening the spreadsheets.


    The code I use is

    Sub CallAllReports()
    '
    ' Call All Weekly Reports Macro
    '
    
    
        Call SDDL_Report
        Call Package_Report
        
        
    End Sub
    
    
    Sub SDDL_Report()
                    
    '   Call SDDL Report
        
        Application.Run "'\\Aumelbw140a\qdms\Roy Hill\SDDL Report Proc.xlsm'!SDDL"
            
    End Sub
       
    
    
    Sub Package_Report()
                    
    '   Call Package Report
        Application.Run "'\\Aumelbw140a\qdms\Roy Hill\Package Report Proc.xlsm'!Package"
        
    End Sub
    But this code runs the SDDL Report multiple times and not the Package Report.

    How can I run both these reports from my macro?

    Cheers,

    JG
    Last edited by Bob Phillips; 04-02-2015 at 09:24 AM. Reason: Added code tags

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What happens if you do away with the subs?

    Sub CallAllReports()
    '
    ' Call All Weekly Reports Macro
    '
    
    '   Call SDDL Report    
        Application.Run "'\\Aumelbw140a\qdms\Roy Hill\SDDL Report Proc.xlsm'!SDDL"
            
    '   Call Package Report
        Application.Run "'\\Aumelbw140a\qdms\Roy Hill\Package Report Proc.xlsm'!Package"
        
    End Sub
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Apr 2015
    Posts
    2
    Location
    That is the way I tried first, but it didn't work. So I tries the sub-routines next, but still no luck.

    Is there an alternative to End Sub?

Posting Permissions

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