Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Can you clear up the discrepancy? Enabled or Disabled first time? Also, do you mean first time the file is opened ever or in a given Excel session? How is this login administered; i.e., a Userform you've incorporated?I want the Cancel button not to be enabled when the user opens the file for the first time but after that the cancel button should be disabled.
Dim IsFirstUse As Boolean
Private Sub UserForm_Initialize()
IsFirstUse = (ThisWorkbook.Names("FirstUse").RefersTo = "=TRUE")
cmdCancel.Enabled = Not IsFirstUse
End Sub
Private Sub UserForm_Terminate()
If IsFirstUse Then
ThisWorkbook.Names("FirstUse").RefersTo = "=FALSE"
ThisWorkbook.Save
End If
End Sub