Macro to check for file update

R

Ray

hi -

I have a workbook 'template' (not an .xla) that will be used many
users spread across the US. The current name of this file is:
CashRec_v11.0_TEMPLATE.xls

Occasional updates of this file will be needed, resulting in an
incremental increase in the version # (ie v11.0 to v11.1 to
v11.2 ....).

I'd like to have a macro that runs On_Open that will check whether a
newer version of the Template exists, with a pop-up box to notify ONLY
if a new version exists?

Thanks!
Ray
 
J

Joel

Folder = "C:\temp"
Templat_Name = "CashRec_v*_TEMPLATE.xls"
OldVersion = 11#

FName = Dir(Folder & "\" & Templat_Name)
FileVersion = Mid(FName, InStr(FName, "_v") + 2)
FileVersion = Left(FileVersion, InStr(FileVersion, "_") - 1)
If Val(FileVersion) > OldVersion Then
MsgBox ("Warning: New Version of " & Templat_Name & " exists")
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top