Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2014, 12:37 AM
DID DID is offline Read the newest file in a folder, how? Windows 7 32bit Read the newest file in a folder, how? Office 2010 32bit
Novice
Read the newest file in a folder, how?
 
Join Date: Jul 2014
Posts: 1
DID is on a distinguished road
Default Read the newest file in a folder, how?

Dear all,



I have very difficult task to do.

We have a kiosk presentation of different data going on in an eternity from a PPT presentation. However I have a folder on the network, where there is a new Excel file created every day at 15.00h. Now I would like somehow this PPT presentation to read the newest Excel file in a certain folder (it is always in the same folder the file is created). In the folder there are only these files. The files created contains a table ranging A4:G16.

So is it possible to program a PPT presentation to read the newest (excel)file in a folder, at a certain time (e.g. 15.30), and show the table ranging A4:G16 from this file?

I would be glad for any help, or even a suggestion where I might find other help!
Reply With Quote
  #2  
Old 07-09-2014, 01:40 AM
JohnWilson JohnWilson is offline Read the newest file in a folder, how? Windows 7 64bit Read the newest file in a folder, how? Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Are you a coder?

This will be tricky and really is probably beyond the help that can be offered here.

You can use the FileScriptingObject to deduce the newest file

Code:
Sub GetMostRecentFile()
Dim objFSO As Object
Dim objFile As Object
Dim objFldr As Object
Dim strFilename As String
Dim lastDate As Date
Dim myDir As String
myDir = ActivePresentation.Path & "\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFldr = objFSO.GetFolder(myDir)
lastDate = DateSerial(1900, 1, 1)
For Each objFile In objFldr.Files
    If objFile.Name Like "*.xls*" Then
        If objFile.DateLastModified > lastDate Then
            lastDate = objFile.DateLastModified
            strFilename = objFile.Name
        End If
    End If
Next objFile
MsgBox strFilename
End Sub
To make the code run at about 15.30 you would probably need to trap the last slide event and check the value for NOW and compare with 15.30
You would probably have to create an instance of Excel , open the relevant file with no window (invisible) and copy and paste the table into PowerPoint. (Not even sure this is possible invisibly)

This is not going to be simple if you are not a reasonable coder!
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read binary data from currently open file? XmisterIS Word VBA 0 04-09-2014 04:38 AM
Weird message “the file ( ) should be opened as read-only unless changes to it need t Jamal NUMAN Word 6 11-13-2013 01:53 AM
Read the newest file in a folder, how? Change personal folder items to 'read" J C M Outlook 1 01-09-2012 10:42 AM
Outlook Does Not Retrieve Email from Newest agusbagus Outlook 0 11-07-2010 07:15 AM
PowerPoint can't read x.ppt file? chronic student PowerPoint 0 05-30-2006 05:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft