View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Auto update pivot tables.

Open the file and do an
ActiveWorkbook.refreshall.

--
Regards,
Tom Ogilvy

"Tony" wrote in message
...
Hi,

I need a spreadsheet that reads an external data source to be updated

befor
being sent by email.


I have a spreadsheet saved as an xlt.
It contains three pivot tables which connect to CSV data files using
Microsoft
Text Driver.
The CSV files are updated overnight by an external application.
The Excel file is in \\Server\Viewers
The Data files are in \\Server\Data

Local users use a shortcut to open the Excel file on \\Server\Viewers

which
the does an auto-update from the CSV files.
That way the the pivot table data is always updated.
(Because I used the auto-update when opening option when I saved the
original Excel file)
All that has been working perfectly for years, locally.

Now I need to send the same excel file to another company by email.
I have succeeded in writing a vbscript that creates a message body and

sends
the message and the excel file via SMTP.
Q.1. Does the Excel file do an autoupdate before being sent ?
Q.2 If not, how can I force it to autoupdate itself so the mail recipient
will have the updated version of the data.

I supposed I could get the vbscript to open the file and go into each

Pivot
table and do a Refresh (F9), but is there an easier way ?


TIA


Seamus
(I posted this yesterday to excel.misc but got no answers.)