Welcome to the forum! Be sure to add the reference as commented. I used early binding. That let's intellisense work for those objects.
You can delete the line that I commented with the .net reference to its collection object.
Sub Deletes_Last_Line()
'Dim objFSO As Object, objFile As Object 'Late Binding
Dim objFSO As FileSystemObject, objFile As TextStream 'Early Binding, Add Reference: Microsoft Scripting Runtime
Dim a As Variant
Const ForReading = 1
Const ForWriting = 2
'Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objFSO = New FileSystemObject
Set objFile = objFSo.OpenTextFile("C:\Users\final\Desktop\wiki.txt", ForReading, True)
a = Split(objFile.ReadAll, vbCrLf)
objFile.Close
ReDim Preserve a(LBound(a) To UBound(a) - 1)
Set objFile = objFSO.OpenTextFile("C:\Users\final\Desktop\wiki.txt", ForWriting, True)
'Lines.RemoveAt (Lines.Count - 1) 'https://docs.microsoft.com/en-us/dotnet/api/system.collections.arraylist.remove?view=netcore-3.1
objFile.WriteLine Join(a, vbCrLf)
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
End Sub