My code works of one Userform but on the other it says "File not found"

MO24

New Member
Joined
Mar 30, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have two separate user forms of which the only difference is the place in which they put the data. The Userform "TaskForm" works fine but when i copied across the code to Userform "AssessmentForm" and changed the relevant details it says "File Not Found" Followed by "Run-time error 361"

The following code is what i was using
VBA Code:
Private Sub Cancel1_Click()
Unload Me
End Sub

Private Sub Clear1_Click()

Subject1.Clear
Level1.Clear
TypeOfTask1.Clear
Description1.Value = ""
DueDate1.Value = ""
Call AssessmentForm_Initialize

End Sub

Private Sub Entry1_Click()

Sheet1.Activate

Cells(18, 8).Value = Subject1.Value
Cells(18, 9).Value = Level1.Value
Cells(18, 10).Value = TypeOfTask1.Value
Cells(18, 11).Value = Description1.Value
Cells(18, 12).Value = DueDate1.Value



    ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort.SortFields.Add2 _
        Key:=Range("Table1[[#All],[Due Date]]"), SortOn:=xlSortOnValues, Order:= _
        xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Lists").ListObjects("Table1").Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With


End Sub

Private Sub AssessmentForm_Initialize()

    Subject1.AddItem "Mathematics"
    Subject1.AddItem "English"
    Subject1.AddItem "Science"
    Subject1.AddItem "Geography"
    Subject1.AddItem "Commerce"
    Subject1.AddItem "Essential Skills"
    Subject1.AddItem "History"
    Subject1.AddItem "Graphics"
    Subject1.AddItem "PDH"
    Subject1.AddItem "PE"
    Subject1.AddItem "Other"
    Level1.AddItem "Assessment"
    Level1.AddItem "Formative"
    Level1.AddItem "Class"
    Level1.AddItem "Other"
    Level1.AddItem "Draft"
    Level1.AddItem "Plan (Assessment)"
    Level1.AddItem "Checkpoint"
    Level1.AddItem "Plan (Checkpoint)"
    TypeOfTask1.AddItem "Essay"
    TypeOfTask1.AddItem "Worksheet"
    TypeOfTask1.AddItem "Exercise"
    TypeOfTask1.AddItem "Exam"
    TypeOfTask1.AddItem "Quiz"
    TypeOfTask1.AddItem "Mindmap"
    TypeOfTask1.AddItem "Notes"
    TypeOfTask1.AddItem "Video"
    TypeOfTask1.AddItem "Read"
    TypeOfTask1.AddItem "Report"
    TypeOfTask1.AddItem "Other"
    TypeOfTask1.AddItem "Checkpoint"
    TypeOfTask1.AddItem "Speech"
    TypeOfTask1.AddItem "Summary"
    TypeOfTask1.AddItem "CAD"

End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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