jgarza0422
New Member
- Joined
- Apr 8, 2019
- Messages
- 9
I am trying to put a security check in some of our excel files in order to be used within our companies domain. Then if it fails do not open the file and if the check is valid then open excel file.
Here is what I got started, any help would be appreciated.
Private Sub Workbook_Open()
Dim chkUserDomain As String
Dim strUserDomain As String
chkUserDomain = "Test"
strUserDomain = Environ$("UserDomain")
If chkUserDomain <> strUserDomain Then
MsgBox "You can not open this file!"
Else
OPEN CURRENT EXCEL FILE????
End Sub
Here is what I got started, any help would be appreciated.
Private Sub Workbook_Open()
Dim chkUserDomain As String
Dim strUserDomain As String
chkUserDomain = "Test"
strUserDomain = Environ$("UserDomain")
If chkUserDomain <> strUserDomain Then
MsgBox "You can not open this file!"
Else
OPEN CURRENT EXCEL FILE????
End Sub