JeffGrant
Well-known Member
- Joined
- Apr 7, 2021
- Messages
- 516
- Office Version
- 365
- Platform
- Windows
Hi All, I have this very simple sub in the ThisWorkbook object.
For some reason, on a regular basis, the workbook does not open on Sheet 5 as instructed. It opens on any other sheet, and usually the sheet that I do not want users to see.
These variables are declared elsewhere.
Public LoginInstance as Integer
Public lrow as Double.
What am I missing?
Thanks in advance
Jeff.
VBA Code:
Option Explicit
Private Sub Workbook_Open()
'Check last row count to determine risk levels
Sheet5.Select
lrow = Cells(Rows.Count, 1).End(xlUp).Row
If lrow > 1000 Then
MsgBox "You need to review formulas in DNCHY2 for risk levels"
End If
Application.Visible = False: frm_Login.Show
Application.WindowState = xlMaximized
LoginInstance = 0
'Set the default import file in case it was changed at the last session
Sheet1.Range("e41").Value = "Main-Report.csv"
'clear previous error in race tracks
Sheet25.Range("O2").Value = ""
End Sub
For some reason, on a regular basis, the workbook does not open on Sheet 5 as instructed. It opens on any other sheet, and usually the sheet that I do not want users to see.
These variables are declared elsewhere.
Public LoginInstance as Integer
Public lrow as Double.
What am I missing?
Thanks in advance
Jeff.