Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
Ciao
Sono AnnaThomas e sarei felice di aiutarti con la tua domanda. In questo forum, siamo consumatori Microsoft proprio come te.
Ecco un esempio di macro VBA che dovrebbe eseguire le operazioni descritte:
Sub CopyChartsToPowerPoint() Declare variables to hold references to Excel objects Dim xlApp come Excel.Application Dim xlWB come Excel.Workbook Dim xlWS come Excel.Worksheet
Declare variables to hold references to PowerPoint objects Dim pptApp come PowerPoint.Application Dim pptPres As PowerPoint.Presentation Dim pptSlide come PowerPoint.Slide
Set references to the Excel objects Set xlApp = GetObject(, "Excel.Application") Set xlWB = xlApp.Workbooks("summary.xlsm") Set xlWS = xlWB.Sheets("charts")
Set a reference to the PowerPoint application Set pptApp = New PowerPoint.Application
Open the PowerPoint presentation Set pptPres = pptApp.Presentations.Open("C:\Path\To\Exposure.pptm")
Loop through the charts in the Excel sheet Per i = 1 A 6 Copy the chart from the Excel sheet xlWS.ChartObjects(i). Copiare
Set a reference to the target slide in the PowerPoint presentation Set pptSlide = pptPres.Slides(i + 1)
Delete any existing shapes on the slide Per ogni forma In pptSlide.Shapes forma. Cancellare Forma successiva
' Incolla il grafico sulla diapositiva pptSlide.Shapes.PasteTipo di dati speciale:=ppPasteEnhancedMetafile Avanti i
Save and close the PowerPoint presentation pptPres.Save pptPres.Chiudi
Clean up object references Imposta pptSlide = Niente Imposta pptPres = Niente Imposta pptApp = Niente Imposta xlWS = Niente Imposta xlWB = Niente Imposta xlApp = Niente Fine sub
Sarà necessario aggiornare il percorso del file per la presentazione di PowerPoint in questa riga di codice:
Set pptPres = pptApp.Presentations.Open("C:\Path\To\Exposure.pptm") Sostituire C:\Path\To\Exposure.pptm con il percorso effettivo del file "Exposure.pptm".
Spero che questo aiuti ;-), fammi sapere se questo è contrario a ciò di cui hai bisogno, sarei comunque utile per rispondere a più delle tue domande.
Migliori saluti
AnnaThomas
Restituisci alla comunità. Aiuta la persona successiva con questo problema indicando se questa risposta ha risolto il tuo problema. Fare clic su Sì o No nella parte inferiore.
Questa risposta è stata tradotta automaticamente. Di conseguenza, potrebbero esserci errori grammaticali o espressioni strane.