Pivot Table through Scheduled Task

D

denrusso

I have a Pivot Table that I would like to run as a scheduled task.
After the report runs, I would like to save the file as a different
name. Is this possible with Excel and scheduled tasks?? Any help
regarding this would be greatly appreciated...


Thanks in advance,
dr
 
E

Ed Ferrero

Hi dr,

You could schedule to open a workbook and use the Workbook_Open event to run
code that updates a Pivot Table and then saves the workbook to a new file.

This is not tested, but something like;

Private Sub Workbook_Open()
Dim SNewName As String
Worksheets(1).PivotTables(1).RefreshTable
SNewName = "MyBook ver " & Now()
ThisWorkbook.Close savechanges:=True, Filename:=SNewName
End Sub

Save in the code pane for the ThisWorkbook object.

Ed Ferrero
http://edferrero.m6.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top