ABRIR PDF DE FORMA CONDICIONADA POR EL NOMBRE
Hola Antoni, este es el codigo al abrir el pdf en cuestion. recuerda que el nombre del archivo de este pdf esta relacionado con la celda d6:
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveWorkbook.Queries.Add Name:="Table001 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table001 = Origen{[Id=""Table001""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table001,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}, {""Column7"", type text}, {""Column8"", type text}, {""Column9"", type text}, {""Column10"", type text}, {""Column11"", type text}, {""Column12"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table002 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table002 = Origen{[Id=""Table002""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table002,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}, {""Column7"", type text}, {""Column8"", type text}, {""Column9"", type text}, {""Column10"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table003 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table003 = Origen{[Id=""Table003""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table003,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table004 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table004 = Origen{[Id=""Table004""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table004,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table005 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table005 = Origen{[Id=""Table005""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Encabezados promovidos"" = Table.PromoteHeaders(Table005, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(#""Encabezados promovidos"",{{""Fecha Proce" & _
"so"", type date}, {""Tipo Doc."", type text}, {""N. Doc."", Int64.Type}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table006 (Page 1)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table006 = Origen{[Id=""Table006""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table006,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table007 (Page 2)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table007 = Origen{[Id=""Table007""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table007,{{""Column1"", type text}, {""Column2"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table008 (Page 2)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table008 = Origen{[Id=""Table008""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table008,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table009 (Page 2)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table009 = Origen{[Id=""Table009""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table009,{{""Column1"", type text}, {""Column2"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table010 (Page 3)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table010 = Origen{[Id=""Table010""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table010,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}, {""Column7"", type text}, {""Column8"", type text}, {""Column9"", type text}, {""Column10"", type text}, {""Column11"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table011 (Page 3)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table011 = Origen{[Id=""Table011""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Encabezados promovidos"" = Table.PromoteHeaders(Table011, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(#""Encabezados promovidos"",{{""Column1"", " & _
"type text}, {""Fuente - Acreedor"", type text}, {""Monto *"", type number}, {""Venc."", Int64.Type}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table012 (Page 3)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table012 = Origen{[Id=""Table012""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Encabezados promovidos"" = Table.PromoteHeaders(Table012, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(#""Encabezados promovidos"",{{""Institucion" & _
"es"", type text}, {""**"", type text}, {""Línea Aprobada"", type text}, {""Línea No Utilizada"", type number}, {""Línea Utilizada"", type text}, {""% L. Uti."", Percentage.Type}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table013 (Page 3)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table013 = Origen{[Id=""Table013""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table013,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table014 (Page 3)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table014 = Origen{[Id=""Table014""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table014,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table015 (Page 4)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table015 = Origen{[Id=""Table015""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table015,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table016 (Page 4)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table016 = Origen{[Id=""Table016""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Encabezados promovidos"" = Table.PromoteHeaders(Table016, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(#""Encabezados promovidos"",{{""Column1"", " & _
"Int64.Type}, {""[image] Fecha desde que#(lf)Nro Documento Nombre de Representante Act Pre 12m ocupa Cargo Cargo"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type text}, {""Column6"", type text}, {""Column7"", type text}, {""Column8"", type date}, {""Column9"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table017 (Page 4)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table017 = Origen{[Id=""Table017""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table017,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}, {""Column7"", type text}, {""Column8"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table018 (Page 4)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table018 = Origen{[Id=""Table018""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table018,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table019 (Page 4)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table019 = Origen{[Id=""Table019""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table019,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}, {""Column4"", type text}, {""Column5"", type tex" & _
"t}, {""Column6"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
ActiveWorkbook.Queries.Add Name:="Table020 (Page 5)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Origen = Pdf.Tables(File.Contents(""E:\Proyecto Risk\PDF2GLDTRANSPORTSAC2902202410454.pdf""), [Implementation=""1.3""])," & Chr(13) & "" & Chr(10) & " Table020 = Origen{[Id=""Table020""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"" = Table.TransformColumnTypes(Table020,{{""Column1"", type text}, {""Column2"", type text}, {""Column3"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Tipo cambiado"""
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table001 (Page 1)", _
"Conexión a la consulta 'Table001 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table001 (Page 1);Extended Properties=" _
, """Table001 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table002 (Page 1)", _
"Conexión a la consulta 'Table002 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table002 (Page 1);Extended Properties=" _
, """Table002 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table003 (Page 1)", _
"Conexión a la consulta 'Table003 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table003 (Page 1);Extended Properties=" _
, """Table003 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table004 (Page 1)", _
"Conexión a la consulta 'Table004 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table004 (Page 1);Extended Properties=" _
, """Table004 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table005 (Page 1)", _
"Conexión a la consulta 'Table005 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table005 (Page 1);Extended Properties=" _
, """Table005 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table006 (Page 1)", _
"Conexión a la consulta 'Table006 (Page 1)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table006 (Page 1);Extended Properties=" _
, """Table006 (Page 1)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table007 (Page 2)", _
"Conexión a la consulta 'Table007 (Page 2)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table007 (Page 2);Extended Properties=" _
, """Table007 (Page 2)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table008 (Page 2)", _
"Conexión a la consulta 'Table008 (Page 2)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table008 (Page 2);Extended Properties=" _
, """Table008 (Page 2)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table009 (Page 2)", _
"Conexión a la consulta 'Table009 (Page 2)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table009 (Page 2);Extended Properties=" _
, """Table009 (Page 2)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table010 (Page 3)", _
"Conexión a la consulta 'Table010 (Page 3)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table010 (Page 3);Extended Properties=" _
, """Table010 (Page 3)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table011 (Page 3)", _
"Conexión a la consulta 'Table011 (Page 3)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table011 (Page 3);Extended Properties=" _
, """Table011 (Page 3)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table012 (Page 3)", _
"Conexión a la consulta 'Table012 (Page 3)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table012 (Page 3);Extended Properties=" _
, """Table012 (Page 3)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table013 (Page 3)", _
"Conexión a la consulta 'Table013 (Page 3)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table013 (Page 3);Extended Properties=" _
, """Table013 (Page 3)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table014 (Page 3)", _
"Conexión a la consulta 'Table014 (Page 3)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table014 (Page 3);Extended Properties=" _
, """Table014 (Page 3)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table015 (Page 4)", _
"Conexión a la consulta 'Table015 (Page 4)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table015 (Page 4);Extended Properties=" _
, """Table015 (Page 4)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table016 (Page 4)", _
"Conexión a la consulta 'Table016 (Page 4)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table016 (Page 4);Extended Properties=" _
, """Table016 (Page 4)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table017 (Page 4)", _
"Conexión a la consulta 'Table017 (Page 4)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table017 (Page 4);Extended Properties=" _
, """Table017 (Page 4)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table018 (Page 4)", _
"Conexión a la consulta 'Table018 (Page 4)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table018 (Page 4);Extended Properties=" _
, """Table018 (Page 4)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table019 (Page 4)", _
"Conexión a la consulta 'Table019 (Page 4)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table019 (Page 4);Extended Properties=" _
, """Table019 (Page 4)""", 6, True, False
Workbooks("RUC 20600975383 - GLD TRANSPORT S.xlsm").Connections.Add2 _
"Consulta - Table020 (Page 5)", _
"Conexión a la consulta 'Table020 (Page 5)' en el libro.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Table020 (Page 5);Extended Properties=" _
, """Table020 (Page 5)""", 6, True, False
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table001 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table001__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table002 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table002__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table003 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table003__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table004 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table004__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table005 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table005__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table006 (Page 1)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table006__Page_1"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table007 (Page 2)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table007__Page_2"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table008 (Page 2)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table008__Page_2"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table009 (Page 2)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table009__Page_2"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table010 (Page 3)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table010__Page_3"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table011 (Page 3)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table011__Page_3"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table012 (Page 3)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table012__Page_3"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table013 (Page 3)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table013__Page_3"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table014 (Page 3)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table014__Page_3"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table015 (Page 4)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table015__Page_4"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table016 (Page 4)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table016__Page_4"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table017 (Page 4)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table017__Page_4"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table018 (Page 4)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table018__Page_4"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table019 (Page 4)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table019__Page_4"
.Refresh
End With
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=4, Source:=ActiveWorkbook. _
Connections("Consulta - Table020 (Page 5)"), Destination:=Range("$A$1")). _
TableObject
.RowNumbers = False
.PreserveFormatting = True
.RefreshStyle = 1
.AdjustColumnWidth = True
.ListObject.DisplayName = "Table020__Page_5"
.Refresh
End With
ActiveWindow.TabRatio = 1
Application.CommandBars("Queries and Connections").Visible = False
Sheets("Table020 (Page 5)").Select
Range("G17").Select
End Sub