Unir varios archivos de excel en una hoja

Quiero unir varios archivos de excel en una hoja pero no deja, lor archivos tienes esta macro, no se ei sera de ayuda

'Lasata Vision Agora XLB MacroBuilder Module © 1999 Lasata Pty Ltd
'
'This module is used by Vision Agora XLB to provide MacroBuilder functionality.
'
'WARNING:
'   All code within this module is subject to change/deletion whenever MacroBuilder is run.
'   As a result, customisations/additions within this module may be deleted when MacroBuilder
'   is used.
'   As a result, it is recommended that you use a different module for your own customisations.
'
Option Explicit
Public Sub LaunchRoutine_62217465740000()
    LaunchXLBMacro "MACRO1"
End Sub
Public Sub MACRO1()
'Se creó usando el Generador de  Macro de Q&A XL 22/06/2011 17:46 por Luis Alberto Garcia Mosquera.
'Generado usando Q&A XL MacroBuilderversión V10.0.3.
    On Error GoTo ErrorHandler
1:
    oXLBMacro.Recalculate LsXLBRecalculateWorksheet, SheetName:=ActiveSheet.Name
    'Ensure Application is ready to resume control
    Application.ScreenUpdating = True
    Application.Interactive = True
    oXLBMacro.MacroDisableScreenUpdating False
    Exit Sub
ErrorHandler:
    MsgBox "Error al ejecutar MACRO1:" & vbCrLf & "Línea: " & Erl & vbCrLf & "Número: " & Err.Number & vbCrLf & "Descripción: " & Err.Description, vbOKOnly, "Error del Macro Q&A XL"
    Application.ScreenUpdating = True
    Application.Interactive = True
    oXLBMacro.MacroDisableScreenUpdating False
    Err.Clear
End Sub
Public Sub LaunchXLBMacro(ByVal ProcedureName As String)
'This procedure determines if the XLB addin is referenced in the current workbook.
'If it isn't, an attempt is made to add the reference.
'If this succeeds, it then runs the procedure whose name is passed.
Dim i As Integer
Dim Referenced As Boolean
    On Error GoTo ReferenceError
    'Add reference
    With ThisWorkbook.VBProject.References
        'Search for Reference to XLB Addin
        For i = 1 To .Count
            If .Item(i).Name = "LsAgXLB" Then  'Found the addin
                Referenced = True
                Exit For
            End If
        Next i
        'Check if it is already referenced
        If Not Referenced Then
            'Add the Reference
            .AddFromFile "C:\Program Files\Infor PM QA\LsAgXLB.xla"
        End If
    End With
Launcher:
    On Error GoTo LaunchError
    Select Case ProcedureName
        Case "MACRO1": MACRO1
        Case Else: Err.Raise 1
    End Select
    Exit Sub
ReferenceError:
    MsgBox "Cannot locate the Vision Agora XLB Add-in.  Aborting.", vbOKOnly, "Vision Macro Error"
    Err.Clear
    Exit Sub
LaunchError:
    MsgBox "Unable to run Macro " & ProcedureName & ".  Aborting", vbOKOnly, "Vision Macro Error"
    Err.Clear
    Application.ScreenUpdating = True
    Application.Interactive = True
End Sub

Añade tu respuesta

Haz clic para o