Foros del Web » Soporte técnico » Ofimática »

Error 1004 en codigo

Estas en el tema de Error 1004 en codigo en el foro de Ofimática en Foros del Web. Buenas tardes a todos: Ojala alguien pueda ayudarme con este codigo ya que me esta marcando un error 1004: Sub MakeBackup2() Dim Archivo$, InvNum$, fn ...
  #1 (permalink)  
Antiguo 12/04/2010, 16:16
Avatar de ccrux713  
Fecha de Ingreso: junio-2007
Ubicación: Campeche
Mensajes: 5
Antigüedad: 16 años, 10 meses
Puntos: 0
Error 1004 en codigo

Buenas tardes a todos:
Ojala alguien pueda ayudarme con este codigo ya que me esta marcando un error 1004:

Sub MakeBackup2()
Dim Archivo$, InvNum$, fn As Variant

Workbooks("CALCULO 2010.xlsm").Activate
ActiveWorkbook.Sheets("Input").Activate

InvNum = Range("S3").Value & ".xlsx"
' Ruta = ActiveSheet.Parent.Path
Archivo = ActiveSheet.Parent.Path & "\Backup\2010\" & Range("S3").Value & ".xlsx"


If Not FileExists(Archivo) Then
MsgBox "The file doesn't exist!"
ActiveWorkbook.Sheets("Input").Copy
ActiveSheet.Shapes("Button 1").Select
Selection.Delete
ActiveSheet.Shapes("Button 2").Select
Selection.Delete
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A8").Select

Application.ActivePrinter = "PDFill PDF&Image Writer on Ne01:"
ExecuteExcel4Macro _
"PRINT(1,,,1,,,,,,,,2,""PDFill PDF&Image Writer on Ne01:"",,TRUE,,FALSE)"


ActiveWorkbook.SaveAs Filename:=Archivo
ActiveWorkbook.Close (True)
Workbooks("CALCULO 2010.xlsm").Activate
Range("S3").Select
Else
MsgBox "The file already exists!" & Chr(13) & "Please, enter a new name"
fn = Application.GetSaveAsFilename(InvNum, "Excel Workbook(*.xlsx),*.xlsx", 1, "Enter the name")
If TypeName(fn) = "Boolean" Then Exit Sub
ActiveWorkbook.SaveAs fn
ActiveWorkbook.Close (True)
Workbooks("CALCULO 2010.xlsm").Activate
Range("S3").Select
End If
End Sub

Me da error en la linea
ActiveWorkbook.SaveAs fn

El error que me da es:

Código:
"This extension can not be used with the selected  file type. Change the file extension in the File name text box or select a different file type by changing  the Save as type."
NOTA: Uso XL 2007.

Gracias por su ayuda.

Última edición por ccrux713; 12/04/2010 a las 16:18 Razón: Me falto agregar la version de XL que uso.

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:38.