arsene2000
New Member
- Joined
- Jun 28, 2017
- Messages
- 4
i have a macro that automate the emailing of pivot tables as PDF, but require me to open the excel worksheet and click the button to launch the macro (private).
I want to automate this, and schedule a task to do it daily.
1/ open the excel worksheet
2/ refresh all connection (eventually the source data will come from a connection)
3/ activate the macro (or simulate the click of the button)
4/ save the excel worksheet
5/ close all instances of excel
i'm really new at this and can't figure out how to launch the click macro (or simulate the click of the button)
My VBS so far is :
Test file is located at TinyUpload.com - best file hosting solution, with no limits, totaly free
Thanks for any help !
I want to automate this, and schedule a task to do it daily.
1/ open the excel worksheet
2/ refresh all connection (eventually the source data will come from a connection)
3/ activate the macro (or simulate the click of the button)
4/ save the excel worksheet
5/ close all instances of excel
i'm really new at this and can't figure out how to launch the click macro (or simulate the click of the button)
My VBS so far is :
Code:
Dim objExcel, objWB
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = TRUE
Set objWB = objExcel.Workbooks.Open("REPO.xlsm")
objWB.RefreshAll
objExcel.Wait (Now + TimeSerial(0, 0,10))
Call RDB_Outlook()
objWB.Close True 'False to not save
objExcel.DisplayAlerts = True
objWB.Close
objExcel.Quit
Set objWB = Nothing
Set objExcel = Nothing
Test file is located at TinyUpload.com - best file hosting solution, with no limits, totaly free
Thanks for any help !