I have a simple macro which essentially checks if the below specified date is the is older than the last modified date of a master file saved in a shared area.
But for some reason when I run it, it get “type mismatch”… but why
Might be worth noting I have the exact same code in the ‘This Workbook’ section of the add-in, which runs on ‘Workbook_Open’. Is that an issue?
But for some reason when I run it, it get “type mismatch”… but why
Might be worth noting I have the exact same code in the ‘This Workbook’ section of the add-in, which runs on ‘Workbook_Open’. Is that an issue?
VBA Code:
Public Sub UpdateCheck(control As IRibbonControl)
Dim CurrentVersionDate As Date
CurrentVersionDate = ("18/11/2021") '<---- MUST UPDATE ON DAY OF NEW VERSION RELEASE IN MM/DD/YYY FORMAT
Dim LastUpdateDate As Date
LastUpdateDate = Int(FileDateTime("P:\SCG\Macros\CommoditiesSuite.xlam"))
If LastUpdateDate > CurrentVersionDate Then
If MsgBox("Last Updated on: " & CurrentVersionDate & vbNewLine & "Latest Available Version: " & LastUpdateDate & vbNewLine & vbNewLine & "Your CommoditiesSuite version is out of date..." & vbNewLine & "Do you want to update?", vbYesNo, "Version Check") = vbYes Then
Workbooks.Open ("P:\SCG\Macros\INSTALL.xlsm")
Else
Exit Sub
End If
Else
Exit Sub
End If