PDA

View Full Version : Running Macros in other Spreadsheets



JGupte
04-01-2015, 08:33 PM
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

Bob Phillips
04-02-2015, 09:25 AM
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

JGupte
04-06-2015, 03:46 PM
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?