Tag: datemodified

比较在VBA中修改的文件date

所以我正在VBA中编写一个代码,用于打开文档中的所有文件,并复制和粘贴每个文档中的信息。 代码设置为打开每个文档,但本身。 我的困境是,我希望代码打开在主文件被修改的最后一天之后修改过的文档。 基本上我想比较两个date,一个date保持不变,另一个更改后每个循环(每个循环的新文档)。 我的代码如下,任何帮助或build议将不胜感激。 谢谢! Sub LoopThroughDirectory() Dim MyFile As String Dim erow Dim Filepath As String Dim DateMaster As Date Dim DateReflections As Date Filepath = "Path of folder where all the documents are" MyFile = Dir(Filepath) DateReflections = FileDateTime(Filepath) DateMaster = FileDateTime("Filepath of master document I'm comparing to") Do While Len(MyFile) > […]