An assignment statement (as ruta = ActiveWorkbook) cannot be used. Outside of a Sub() or Function is the Path ()
Therefore, take into account the following adjustments to your ruta-related variables along with a few more recommendations/advice.
Public varRuta As String
Public Const varRutaLastBit = "\ValidacionesSunat"
varRuta = ActiveWorkbook.Path & varRutaLastBit
'variables that you need to use in the code
Dim TextFile As Integer
Dim iCol As Long '<-- use Long instead of Integer
Dim myRange As Range
Dim cVal As Range
Dim i As Long, _
j As Long, _
k As Long, _
l As Long, _
m As Long
Dim myFile As String
Dim valores As Long
Dim batch '<-- implicitly assumed As Variant
Dim batchDe10 '<-- implicitly assumed As Variant
On Error Resume Next
Kill varRuta & "."
On Error GoTo 0
Please be aware that any missing type declarations right after a variable may cause the VBA interpreter to treat the variable as being of type "Variant" with regard to any comments or suggestions regarding Dim.