SamarthSalunkhe
Board Regular
- Joined
- Jun 14, 2021
- Messages
- 103
- Office Version
- 2016
- Platform
- Windows
Hello Everyone,
I am using LoginInstance (Snapshot is below), but when Excel Contains are not Enabled then the user can see data of sheet. I am trying to use the below VBA code (where I have given command as the user can see a blank sheet with the name of ("Macro-disabled") when Excel Contains are not Enabled) but I'm getting an Error (Snapshot is below).
Can someone provide a solution?
LoginInstance (Snapshot)
Error (Snapshot is below)
I am using LoginInstance (Snapshot is below), but when Excel Contains are not Enabled then the user can see data of sheet. I am trying to use the below VBA code (where I have given command as the user can see a blank sheet with the name of ("Macro-disabled") when Excel Contains are not Enabled) but I'm getting an Error (Snapshot is below).
Can someone provide a solution?
LoginInstance (Snapshot)
Error (Snapshot is below)
VBA Code:
Private Sub Workbook_Open()
'To Show Login Form
LoginInstance = 0
Application.Visible = False
frmLogin.Show
'Step 1: Declare your variables
Dim ws As Worksheet
'Step 2: Start looping through all worksheets
For Each ws In ThisWorkbook.Worksheets
'Step 3: Unhide All Worksheets
ws.Visible = xlSheetVisible
'Step 5: Loop to next worksheet
Next ws
'Step 6: Hide the Start Sheet
Sheets("Macro-disabled").Visible = xlVeryHidden
End Sub