PDA

View Full Version : Auto-update links PPT and Excel



wolf.stalker
09-20-2009, 07:10 PM
Quick question.

I am going to have a PowerPoint presentation running constantly on a monitor in my group's area. This PPP will be pulling data from an Excel workbook that is updated frequently.

Is there a way to force PowerPoint to auto update by way of vba code say every 5 min or whenever the source changes?

One more thing. My group is going from office 03 to office 07 so the solution will have to at least work for 07.

thanks for your help!

-wm

mike31z
02-13-2010, 10:34 AM
http://www.vbaexpress.com/forum/showthread.php?p=205661#post205661

The link is almost the same subject look at that frirst the come back here.

Lesson learned for this type of project: Since your source is on ( x ) number of files that others input data into, I recommend you create a seperate spreadsheet with all the links to other xls file that are network locations and store that consolidated spreadsheet in the same folder as the powerpoint file.

The new problem is to automatically update(refresh) the spreadsheet file links. Here how I do it.

This goes in a Module for the spreadsheet that is the interface to the powerpoint.


Dim mdteScheduledTime As Date
'
'change the \\Squad\team09\Team09.xls (file://\\Squad\team09\Team09.xls) to your source file
' add extra lines for each file location
'source data must be saved file can be open.
'Change (0,3,0) to meet your needs time is set at 3 min
'Format for time is (Hours, Minutes, Seconds)
'
'
'Good luck

Sub RefreshData()
ThisWorkbook.UpdateLink Name:="\\Squad\team09\Team09.xls (file://\\Squad\team09\Team09.xls)", Type:=xlExcelLinks
mdteScheduledTime = Now + TimeSerial(0, 3, 0)
Application.OnTime mdteScheduledTime, "RefreshData"
End Sub
Sub StopRefresh()
Application.OnTime mdteScheduledTime, "RefreshData", , False
End Sub



To run the code open your MACROS (ALT+F8) and RUN "RefreshData"
That turns the timer on.
At the end of the slide show RUN "StopRefresh" if you are going to keep using excel for other projects.

The xls source data must be in some kind of shared folder.
I would create a Mapped drive using the same letters so the code doesn't have to be changed.
You may need to verify the mapped drive link before the show starts but that should only be daily.



good luck :beerchug:

Mike