Quitar de macro la parte que crea un xlsx
De tu macro, quitar la parte que menciona el titulo solamente
NO CABE toda la macro, en una respuesta dejo lo que falta de la macro
Sub GuardaSinMacros() 'guarda una copia .xlsx TOTALMENTE protegida, una copia PDF, elimina botones, 'desprotege y protege la origen Dim ruta As String Dim nombre As String Dim wb As Object Dim i As Long Dim d As String ruta = "D:\Datos Mecanicos\" Application.ScreenUpdating = False Application.DisplayAlerts = False ActiveSheet.Unprotect "By Jot@" With ThisWorkbook.Sheets(1) Set h1 = ActiveSheet nombre = Ini(Quitar(.Range("G4"))) & "_" & h1.Name & " " & Format(.Range("H3"), "20-0000") & _ " " & .Range("C11") & "_" & .Range("C13") & "_" & .Range("D13") & "_" & .Range("H13") & _ "_" & .Range("I13") & " " & .Range("J13").Value 'XXXXXXXX 'El cuadro dialogo abre en la carpeta de rut Guardar copia desde el cuadro dialogo With Application.FileDialog(msoFileDialogFolderPicker) 'Abre el cuadro dialogo .Title = "Selecciona destino" .AllowMultiSelect = False .InitialFileName = ruta 'Si cancela sale de la macro If .Show <> -1 Then Exit Sub ruta = .SelectedItems(1) & "\" End With 'XXXXXXXX .Copy End With Set wb = Workbooks(Workbooks.Count) With wb With .Sheets(1) For i = .Shapes.Count To 1 Step -1 d = .Shapes(i).TopLeftCell.Address(False, False) Select Case d Case "J2": .Shapes(i).Delete Case "J3": .Shapes(i).Delete Case "L3": .Shapes(i).Delete Case "L4": .Shapes(i).Delete End Select 'wb.Sheets(1).DisplayHorizontalScrollBar = False Next '¿?¿?¿? DESDE AQUI .SaveAs Filename:=ruta & nombre & ".xlsx", FileFormat:=xlOpenXMLWorkbook, _ CreateBackup:=False '¿?¿?¿? HASTA AQUI With .Range("B2:J60") .ExportAsFixedFormat Type:=xlTypePDF, Filename:=ruta & nombre & ".pdf", _ Quality:=xlQualityStandard, IncludeDocProperties:=True, _ IgnorePrintAreas:=False, OpenAfterPublish:=False .Copy .PasteSpecial xlPasteValues Application.CutCopyMode = False Range("A2").Select 'DEseleccionar el rango en la copia End With With .Cells .Locked = True .FormulaHidden = False End With
Respuesta de Tor Cheer
1