I wrote this code:
Sub CommandButton1_Click()
ruta = ActiveWorkbook.Path
Sheets("Hoja de datos").Select
Sheets("Hoja de datos").Copy
nombre = ActiveWorkbook.Name
CompletePathName = ruta & "\" & nombre
ActiveWorkbook.SaveAs Filename:=CompletePathName,
FileFormat:=xltxt
mensaje = "La hoja de datos se guardo en " & ruta
MsgBox (mensaje)
End Sub
The problem is that the file is stored in format xls, instead of txt.
What did I do wrong?