Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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,913
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
 



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 04:37 PM.


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