Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello folks.
I'm trying to develop a multi-stage macro that will access a group of files, and look at the last saved date. If that date is more recent than the file the macro is calling from, I want to open, and then copy a portion of the second file into the first. We've purchased the WROX Excel 2007 VBA programmer's reference manual, but I'm not able to readily identify the information I'm seeking to accomplish the above. So, at this point, I want to accomplish the following: 1- have the code to look at the save date in the properties of fileB. 2- if that date is more recent than the last save date of fileA, open fileB. does anoyone know where I can look in the programmer's reference book to learn more on how to perform this? Or, how to do this? Thank you. Best. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ShowFolderInfo()
Dim fs, myfolder, myfiles Const MyPath = "c:\temp" Set fs = CreateObject("Scripting.FileSystemObject") Filename = UCase(ThisWorkbook.Name) If Right(Filename, 3) < "XLS" Then MsgBox ("File does not exist because Wrokbook was not saved") End If Set ThisFile = fs.getfile(ThisWorkbook.Name) Thisdate = ThisFile.datelastmodified Set myfolder = fs.GetFolder(MyPath) For Each Filename In myfolder.Files If UCase(Right(Filename.Name, 3)) = "XLS" Then datemodified = Filename.datelastmodified If datemodified Thisdate Then 'enter your code here End If End If Next Filename End Sub "SteveDB1" wrote: Hello folks. I'm trying to develop a multi-stage macro that will access a group of files, and look at the last saved date. If that date is more recent than the file the macro is calling from, I want to open, and then copy a portion of the second file into the first. We've purchased the WROX Excel 2007 VBA programmer's reference manual, but I'm not able to readily identify the information I'm seeking to accomplish the above. So, at this point, I want to accomplish the following: 1- have the code to look at the save date in the properties of fileB. 2- if that date is more recent than the last save date of fileA, open fileB. does anoyone know where I can look in the programmer's reference book to learn more on how to perform this? Or, how to do this? Thank you. Best. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel should have a function for last date and time file was saved | Excel Worksheet Functions | |||
Can I access the previous version of a saved file? | Excel Discussion (Misc queries) | |||
Update a formula based on date worksheet was saved | Excel Worksheet Functions | |||
Last Saved Date and Time | Excel Programming | |||
How to have:= NOW () date/time change only if updated and saved | Excel Worksheet Functions |