#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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 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! |
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 |
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 |