Automate Report Builder with Task Scheduler

Published: 17 October 2016
on channel: CMG Audience Analytics
2,700
5

How to automate excel workbooks with report builder refresh.

--------------------------------------------------------------
Macro code:
Sub RefreshAllReportBuilderRequests()

Dim addIn As COMAddIn
Dim automationObject As Object
Dim success As String
Set addIn = Application.COMAddIns("ReportBuilderAddIn.Connect")
Set automationObject = addIn.Object
success = automationObject.RefreshAllRequests(ActiveWorkbook)

End Sub
--------------------------------------------------------------
VBS code:

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("D:\Dropbox\Alteryx\Scheduled Jobs - Production\Excel\AAS Daily Report\AAS Daily Report-automation.xlsm")

xlApp.Run "RefreshAllReportBuilderRequests"

WScript.Sleep 12000
xlBook.SaveAS ("D:\Dropbox\Alteryx\Scheduled Jobs - Production\Excel\AAS Daily Report\AAS Daily Report-D-" & Year(Now) & Right("0" & Month(DateAdd("d", -1, Date)),2) & Right("0" & Day(DateAdd("d", -1, Date)),2) & "-" & Year(Now) & Right("0" & Month(DateAdd("d", -1, Date)),2) & Right("0" & Day(DateAdd("d", -1, Date)),2) & ".xlsm")

xlBook.Close SaveChanges=True

xlApp.Quit

Set xlApp = Nothing
Set xlBook = Nothing
--------------------------------------------------------------
Batch code:
start "" "D:\Dropbox\Alteryx\Scheduled Jobs - Production\Excel\AAS Daily Report\Run Macro.vbs"


Watch video Automate Report Builder with Task Scheduler online without registration, duration hours minute second in high quality. This video was added by user CMG Audience Analytics 17 October 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,700 once and liked it 5 people.