ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to check for file update (https://www.excelbanter.com/excel-programming/407094-macro-check-file-update.html)

Ray

Macro to check for file update
 
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

joel

Macro to check for file update
 
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


"Ray" wrote:

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



All times are GMT +1. The time now is 10:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com