ERROR DE COMPILACION EL PROCEDIMIENTO EXTERNO NO ES VALIDO
Publicado por Johana (1 intervención) el 03/09/2020 21:39:17
Hola a todos,
quiero hacer una correspondencia de Excel a power point, pero me arroja " Error de compilación: El procedimiento externo no es valido" me podrán ayudar, abajo el algoritmo, gracias.
[url]Sub combinaCorrespondencia()
Dim BaseDatos As Worksheet
Dim variable1 As String
Dim variable2 As String
Dim variable3 As String
Dim filainicial As Long
Dim crearObjPowerPoint As Object
Dim LibroPowerPoint As Object
Dim HojaPowerPoint As Object
Dim NombreVariable As Object
Set BaseDatos = Worksheets("BD")
Set crearObjPowerPoint = CreateObject("Powerpoint.Application")
crearObjPowerPoint.Visible = True
Set LibroPowerPoint = crearObjPowerPoint.presentations.Open(ThisWorkbook.Path & "\Plantilla.pptx")
LibroPowerPoint.SaveAs ThisWorkbook.Path & "\combinacionesCorrespondencia.pptx"
filainicial = 2
Do While BaseDatos.cell(filainicial, 1) <> ""
variable1 = BaseDatos.Cells(filainicial, 1)
variable2 = BaseDatos.Cells(filainicial, 2)
variable3 = BaseDatos.Cells(filainicial, 3)
Set HojaPowerPoint = LibroPowerPoint.slide(1).Duplicate
For Each NombreVariable In HojaPowerPoint.Shapes
If NombreVariable.HasTextFrame Then
If NombreVariable.TextFrame Then
NombreVariable.TextFrame.TextRange.Replace "<NOMBRE>", variable1
NombreVariable.TextFrame.TextRange.Replace "<CURSO>", variable2
NombreVariable.TextFrame.TextRange.Replace "<FECHA>", variable3
End If
End If
Next[/url]
quiero hacer una correspondencia de Excel a power point, pero me arroja " Error de compilación: El procedimiento externo no es valido" me podrán ayudar, abajo el algoritmo, gracias.
[url]Sub combinaCorrespondencia()
Dim BaseDatos As Worksheet
Dim variable1 As String
Dim variable2 As String
Dim variable3 As String
Dim filainicial As Long
Dim crearObjPowerPoint As Object
Dim LibroPowerPoint As Object
Dim HojaPowerPoint As Object
Dim NombreVariable As Object
Set BaseDatos = Worksheets("BD")
Set crearObjPowerPoint = CreateObject("Powerpoint.Application")
crearObjPowerPoint.Visible = True
Set LibroPowerPoint = crearObjPowerPoint.presentations.Open(ThisWorkbook.Path & "\Plantilla.pptx")
LibroPowerPoint.SaveAs ThisWorkbook.Path & "\combinacionesCorrespondencia.pptx"
filainicial = 2
Do While BaseDatos.cell(filainicial, 1) <> ""
variable1 = BaseDatos.Cells(filainicial, 1)
variable2 = BaseDatos.Cells(filainicial, 2)
variable3 = BaseDatos.Cells(filainicial, 3)
Set HojaPowerPoint = LibroPowerPoint.slide(1).Duplicate
For Each NombreVariable In HojaPowerPoint.Shapes
If NombreVariable.HasTextFrame Then
If NombreVariable.TextFrame Then
NombreVariable.TextFrame.TextRange.Replace "<NOMBRE>", variable1
NombreVariable.TextFrame.TextRange.Replace "<CURSO>", variable2
NombreVariable.TextFrame.TextRange.Replace "<FECHA>", variable3
End If
End If
Next[/url]
Valora esta pregunta


0