Sub Delete_some_Keys()
For i = 0 To Settings.SettingsMap.Size -1
For Each myDeviceN As String In Settings.SettingsMap.Keys
If (myDeviceN) = ("MyDeviceName|" & (i)) Then '<------------ I get this error here
SettingsMap.Remove("MyDeviceName|" & (i))
End If
Next
Next
File.WriteMap(File.DirInternal,SettingsFile, SettingsMap)
End Sub