Hidden External Reference?

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:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,214,875
Messages
6,122,046
Members
449,063
Latest member
ak94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top