The ACSReport sub passes strings to the ProcessReport procedure. I think it's self explanatory.
Sub ACSReport()
ProcessReport "C:\Users\chs103233\Documents\reports\DeerFoot\", "ACS Sample Report.xlsb", _
"C:\Users\chs103233\Documents\reports\DeerFoot mail\", "AgentCallSummaryReport.xlsx", _
"formatACS", "Agent Call Summary Report has been processed."
End Sub
'-----------Process Reports-----------------
Sub ProcessReport(strPath As String, strFile As String, _
strSavePath As String, strSaveFile As String, _
strFormat As String, strMsg As String)
Application.ScreenUpdating = False
With Workbooks.Open(strPath & strFile)
.Sheets(1).Copy 'copy sheet as a new workbook
.Close SaveChanges:=False
End With
'------------------Calls Sub to Format the Report----------------------------
Application.Run strFormat 'Process the Active sheet; the one that was just copied
'----------Saves the Active Workbook inside the appropriate folder ---------------
ActiveWorkbook.SaveAs strSavePath & strSaveFile
ActiveWorkbook.Close
Application.ScreenUpdating = True
'---------message box saying that job is complete ---------------
MsgBox strMsg, vbInformation, ""
End Sub
Bookmarks