sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
I seem to be having an external reference issue here I can't figure out. The first batch of code is from ThisWorkbook and I posted because it is referenced in the problem code. The problem comes when I hit the cmdbutton 2 in the code below. It says it can't find an external reference. I had this userform in another workbook and moved it the other workbook (to figure out this was my reference problem). The issue is that I can't find the reference here. Does anyone else know what it might be? Thanks
Code:
Public Function cInputBox() As String
With New Initializer
.Show
cInputBox = .Value
End With
On Error Resume Next
End Function
Rich (BB code):
Private Sub CommandButton1_Click()
With ActiveWorkbook
.Sheets("Notes").Select
End With
Application.Visible = True
Unload Me
ThisWorkbook.Activate
Exit Sub
End Sub
Private Sub CommandButton2_Click()
Dim name As String
name = ThisWorkbook.Sheets("Notes").Range("A1")
Sheets("Settings").Activate
TryAgain:
Pass = InputBox("Enter Password", "The Coding Sheets")
If Pass = "" Then Exit Sub
If Pass = CStr(Worksheets("Settings").Range("B23").Value) Then
Sheets("Settings").Visible = True
Sheets("Settings").Select
Application.Visible = True
Else
MsgBox "Password incorrect, Please try again", vbCritical, name
GoTo TryAgain
End If
Unload Me
ThisWorkbook.Activate
End Sub
Private Sub CommandButton3_Click()
Unload Me
Welcome.Show
End Sub
Private Sub UserForm_Initialize()
Caption = ThisWorkbook.Sheets("Settings").Range("A1")
End Sub
Private Sub Userform_QueryClose(cancel As Integer, closemode As Integer)
If closemode = 0 Then
If Workbooks.Count > 1 Then
ActiveWorkbook.Close
Else: Application.Quit
End If
End If
End Sub[\code]
Last edited by a moderator: