quiero pasar una base de datos de excel a powerpoint pero cada vez que se genera el archivo se crea en las mismas diapositivas , quiero que se haga en el orden de la base de datos en la misma diapostiva
Opción explícita
Sub Combina Correspondencia()
Dim strBaseDatos como hoja de trabajo
Dim strGanador As String
Opción explícita
Sub Combina Correspondencia()
Dim strBaseDatos como hoja de trabajo
Dim strGanador As String
Dim srtTítul
ficial As String
Dim strNombre_Zona como cadena
Dim strLOGRO como cadena
Dim filaInicial tan largo
Dim CrearObjPowerPoint como objeto
Dim LibroPowerPoint como objeto
Dim HojaPowerPoint Como Objeto
Dim NombreVariable As Object
Establecer strBaseDatos = Hojas de trabajo (BD)
Establecer CrearObjPowerPoint = CreateObject(Powerpoint.Application)
CrearObjPowerPoint.Visible = Verdadero
Establecer LibroPowerPoint = CrearObjPowerPoint.presentations.Open(ThisWorkbook.Path & Plantilla.pptx)
LibroPowerPoint.SaveAs ThisWorkbook.Path & CombinacionesCorrespondencia.pptx
filaInicial = 10
Hacer Mientras strBaseDatos.Cells(filaInicial, 1)
strGanador = strBaseDatos.Cells(filaInicial, 7)
srtTítul
ficial = strBaseDatos.Cells(filaInicial, 8)
strNombre_Zona = strBaseDatos.Cells(filaInicial, 10)
strLOGRO = strBaseDatos.Cells(filaInicial, 12)
Establecer HojaPowerPoint = LibroPowerPoint.slides(1).Duplicar
Para Cada NombreVariable En HojaPowerPoint.Shapes
Si NombreVariable.HasTextFrame Entonces
Si NombreVariable.TextFrame.HasText Entonces
NombreVariable.TextFrame.TextRange.Replace Ganador, strGanador
NombreVariable.TextFrame.TextRange.Replace Títul
ficial, srtTítul
ficial
NombreVariable.TextFrame.TextRange.Replace Nombre_Zona, strNombre_Zona
NombreVariable.TextFrame.TextRange.Replace LOGRO, strLOGRO
Terminara si
Terminara si
Próximo
filaInicial = filaInicial + 1
Bucle
LibroPowerPoint.slides(1).Borrar
LibroPowerPoint.Guardar
LibroPowerPoint.Cerrar
Finalizar sub
Opción explícita
Sub Combina Correspondencia()
Dim strBaseDatos como hoja de trabajo
Dim strGanador As String
Opción explícita
Sub Combina Correspondencia()
Dim strBaseDatos como hoja de trabajo
Dim strGanador As String
Dim srtTítul

Dim strNombre_Zona como cadena
Dim strLOGRO como cadena
Dim filaInicial tan largo
Dim CrearObjPowerPoint como objeto
Dim LibroPowerPoint como objeto
Dim HojaPowerPoint Como Objeto
Dim NombreVariable As Object
Establecer strBaseDatos = Hojas de trabajo (BD)
Establecer CrearObjPowerPoint = CreateObject(Powerpoint.Application)
CrearObjPowerPoint.Visible = Verdadero
Establecer LibroPowerPoint = CrearObjPowerPoint.presentations.Open(ThisWorkbook.Path & Plantilla.pptx)
LibroPowerPoint.SaveAs ThisWorkbook.Path & CombinacionesCorrespondencia.pptx
filaInicial = 10
Hacer Mientras strBaseDatos.Cells(filaInicial, 1)
strGanador = strBaseDatos.Cells(filaInicial, 7)
srtTítul

strNombre_Zona = strBaseDatos.Cells(filaInicial, 10)
strLOGRO = strBaseDatos.Cells(filaInicial, 12)
Establecer HojaPowerPoint = LibroPowerPoint.slides(1).Duplicar
Para Cada NombreVariable En HojaPowerPoint.Shapes
Si NombreVariable.HasTextFrame Entonces
Si NombreVariable.TextFrame.HasText Entonces
NombreVariable.TextFrame.TextRange.Replace Ganador, strGanador
NombreVariable.TextFrame.TextRange.Replace Títul


NombreVariable.TextFrame.TextRange.Replace Nombre_Zona, strNombre_Zona
NombreVariable.TextFrame.TextRange.Replace LOGRO, strLOGRO
Terminara si
Terminara si
Próximo
filaInicial = filaInicial + 1
Bucle
LibroPowerPoint.slides(1).Borrar
LibroPowerPoint.Guardar
LibroPowerPoint.Cerrar
Finalizar sub