Excel x powepoint ayuda

Kelter

New Member
Joined
Jun 25, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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ítulo_Oficial 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ítulo_Oficial = 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ítulo_Oficial, srtTítulo_Oficial

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
 

Attachments

  • Captura2.PNG
    Captura2.PNG
    83.1 KB · Views: 8
  • Captura.PNG
    Captura.PNG
    78.7 KB · Views: 8

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,215,073
Messages
6,122,976
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top