Excel to update PowerPoint Presentation





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a presentation and I have to update it every week. The information I update are a bunch of imagens I generate from a Excel pivot tables (copy from Excel and paste directly on PowerPoint).
Today I can do this doing this:



Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set PPTPrez =
objPPT.Presentations.Open("\network_folderpresentation.pptm")
Set pSlide = PPTPrez.Slides(2)
If pSlide.Shapes.Count <> 0 Then
ActiveWorkbook.Sheets("Pivot1").Range("A8:Z18").CopyPicture
pSlide.Shapes.Paste
EndIf


It work flawless... But I need a litle bit more control and precision...
I need to select the current image on slide, delete it and paste the new one in the same location... Some slides have 3 images or more...
I cann't figure it out how to properly tell to VBA what image are what and choose the pivot table with the correct info for that image... I don't even know if this is possible...
But another solution I have tried is how to specify the position and dimensions of the image on the slide... I can before update, delete all imagens... In this scenario, how to specify the dimensions and positioning?



Thanks!!!



Ps.: Sorry my bad english










share|improve this question

























  • I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

    – Pᴇʜ
    Nov 22 '18 at 14:14













  • It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

    – Rodrigo Kroehn
    Nov 22 '18 at 18:39











  • @RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

    – Pᴇʜ
    Nov 23 '18 at 7:03


















0















I have a presentation and I have to update it every week. The information I update are a bunch of imagens I generate from a Excel pivot tables (copy from Excel and paste directly on PowerPoint).
Today I can do this doing this:



Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set PPTPrez =
objPPT.Presentations.Open("\network_folderpresentation.pptm")
Set pSlide = PPTPrez.Slides(2)
If pSlide.Shapes.Count <> 0 Then
ActiveWorkbook.Sheets("Pivot1").Range("A8:Z18").CopyPicture
pSlide.Shapes.Paste
EndIf


It work flawless... But I need a litle bit more control and precision...
I need to select the current image on slide, delete it and paste the new one in the same location... Some slides have 3 images or more...
I cann't figure it out how to properly tell to VBA what image are what and choose the pivot table with the correct info for that image... I don't even know if this is possible...
But another solution I have tried is how to specify the position and dimensions of the image on the slide... I can before update, delete all imagens... In this scenario, how to specify the dimensions and positioning?



Thanks!!!



Ps.: Sorry my bad english










share|improve this question

























  • I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

    – Pᴇʜ
    Nov 22 '18 at 14:14













  • It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

    – Rodrigo Kroehn
    Nov 22 '18 at 18:39











  • @RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

    – Pᴇʜ
    Nov 23 '18 at 7:03














0












0








0








I have a presentation and I have to update it every week. The information I update are a bunch of imagens I generate from a Excel pivot tables (copy from Excel and paste directly on PowerPoint).
Today I can do this doing this:



Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set PPTPrez =
objPPT.Presentations.Open("\network_folderpresentation.pptm")
Set pSlide = PPTPrez.Slides(2)
If pSlide.Shapes.Count <> 0 Then
ActiveWorkbook.Sheets("Pivot1").Range("A8:Z18").CopyPicture
pSlide.Shapes.Paste
EndIf


It work flawless... But I need a litle bit more control and precision...
I need to select the current image on slide, delete it and paste the new one in the same location... Some slides have 3 images or more...
I cann't figure it out how to properly tell to VBA what image are what and choose the pivot table with the correct info for that image... I don't even know if this is possible...
But another solution I have tried is how to specify the position and dimensions of the image on the slide... I can before update, delete all imagens... In this scenario, how to specify the dimensions and positioning?



Thanks!!!



Ps.: Sorry my bad english










share|improve this question
















I have a presentation and I have to update it every week. The information I update are a bunch of imagens I generate from a Excel pivot tables (copy from Excel and paste directly on PowerPoint).
Today I can do this doing this:



Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set PPTPrez =
objPPT.Presentations.Open("\network_folderpresentation.pptm")
Set pSlide = PPTPrez.Slides(2)
If pSlide.Shapes.Count <> 0 Then
ActiveWorkbook.Sheets("Pivot1").Range("A8:Z18").CopyPicture
pSlide.Shapes.Paste
EndIf


It work flawless... But I need a litle bit more control and precision...
I need to select the current image on slide, delete it and paste the new one in the same location... Some slides have 3 images or more...
I cann't figure it out how to properly tell to VBA what image are what and choose the pivot table with the correct info for that image... I don't even know if this is possible...
But another solution I have tried is how to specify the position and dimensions of the image on the slide... I can before update, delete all imagens... In this scenario, how to specify the dimensions and positioning?



Thanks!!!



Ps.: Sorry my bad english







excel vba excel-vba powerpoint powerpoint-vba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 14:11









Pᴇʜ

25.3k63052




25.3k63052










asked Nov 22 '18 at 14:08









Rodrigo KroehnRodrigo Kroehn

53




53













  • I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

    – Pᴇʜ
    Nov 22 '18 at 14:14













  • It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

    – Rodrigo Kroehn
    Nov 22 '18 at 18:39











  • @RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

    – Pᴇʜ
    Nov 23 '18 at 7:03



















  • I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

    – Pᴇʜ
    Nov 22 '18 at 14:14













  • It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

    – Rodrigo Kroehn
    Nov 22 '18 at 18:39











  • @RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

    – Pᴇʜ
    Nov 23 '18 at 7:03

















I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

– Pᴇʜ
Nov 22 '18 at 14:14







I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.

– Pᴇʜ
Nov 22 '18 at 14:14















It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

– Rodrigo Kroehn
Nov 22 '18 at 18:39





It's a good solution but I need the presentaion don't have links to files...It travels around the company and image, I think, it's the ony way to preserve the information.

– Rodrigo Kroehn
Nov 22 '18 at 18:39













@RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

– Pᴇʜ
Nov 23 '18 at 7:03





@RodrigoKroehn I think it will just keep the old values if the link to the source file is not available anymore (you can test it) and update if the link source is available. So maybe it is worth a second look.

– Pᴇʜ
Nov 23 '18 at 7:03












1 Answer
1






active

oldest

votes


















0














This example (based on your code) may point you in the right direction. You need to know the powerpoint shape name (which you can get via VBA or via the ribbon Home-Select-Selection Pane.



Option Explicit

Public Sub UpdateShapes()

Dim vPowerPoint As PowerPoint.Application
Dim vPresentation As Presentation
Dim vSlide As Slide

Dim vShapeName As String
Dim vShape, vNewShape

Set vPowerPoint = New PowerPoint.Application
vPowerPoint.Visible = True

' Open the powerpoint presentation
Set vPresentation = vPowerPoint.Presentations.Open("\network_folderpresentation.pptm")

' Set slide to be worked on
Set vSlide = vPresentation.Slides(2)

' Set shape to (for this example) "Picture 3"
vShapeName = "Picture 3"
Set vShape = vSlide.Shapes(vShapeName)

' Copy and paste new shape (picture) of range specified
ThisWorkbook.Sheets("Sheet1").Range("A6:B9").CopyPicture
Set vNewShape = vSlide.Shapes.Paste

' Align size and position of new shape to that of old shape
With vNewShape
.Width = vShape.Width
.Height = vShape.Height
.Left = vShape.Left
.Top = vShape.Top
End With

' Delete original shape, rename new shape to original so code works next replace cycle
vSlide.Shapes(vShapeName).Delete
vNewShape.Name = vShapeName

End Sub





share|improve this answer
























  • This is perfect!!!! Works like a charm... Thank you very much!!!

    – Rodrigo Kroehn
    Nov 23 '18 at 18:12












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432768%2fexcel-to-update-powerpoint-presentation%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This example (based on your code) may point you in the right direction. You need to know the powerpoint shape name (which you can get via VBA or via the ribbon Home-Select-Selection Pane.



Option Explicit

Public Sub UpdateShapes()

Dim vPowerPoint As PowerPoint.Application
Dim vPresentation As Presentation
Dim vSlide As Slide

Dim vShapeName As String
Dim vShape, vNewShape

Set vPowerPoint = New PowerPoint.Application
vPowerPoint.Visible = True

' Open the powerpoint presentation
Set vPresentation = vPowerPoint.Presentations.Open("\network_folderpresentation.pptm")

' Set slide to be worked on
Set vSlide = vPresentation.Slides(2)

' Set shape to (for this example) "Picture 3"
vShapeName = "Picture 3"
Set vShape = vSlide.Shapes(vShapeName)

' Copy and paste new shape (picture) of range specified
ThisWorkbook.Sheets("Sheet1").Range("A6:B9").CopyPicture
Set vNewShape = vSlide.Shapes.Paste

' Align size and position of new shape to that of old shape
With vNewShape
.Width = vShape.Width
.Height = vShape.Height
.Left = vShape.Left
.Top = vShape.Top
End With

' Delete original shape, rename new shape to original so code works next replace cycle
vSlide.Shapes(vShapeName).Delete
vNewShape.Name = vShapeName

End Sub





share|improve this answer
























  • This is perfect!!!! Works like a charm... Thank you very much!!!

    – Rodrigo Kroehn
    Nov 23 '18 at 18:12
















0














This example (based on your code) may point you in the right direction. You need to know the powerpoint shape name (which you can get via VBA or via the ribbon Home-Select-Selection Pane.



Option Explicit

Public Sub UpdateShapes()

Dim vPowerPoint As PowerPoint.Application
Dim vPresentation As Presentation
Dim vSlide As Slide

Dim vShapeName As String
Dim vShape, vNewShape

Set vPowerPoint = New PowerPoint.Application
vPowerPoint.Visible = True

' Open the powerpoint presentation
Set vPresentation = vPowerPoint.Presentations.Open("\network_folderpresentation.pptm")

' Set slide to be worked on
Set vSlide = vPresentation.Slides(2)

' Set shape to (for this example) "Picture 3"
vShapeName = "Picture 3"
Set vShape = vSlide.Shapes(vShapeName)

' Copy and paste new shape (picture) of range specified
ThisWorkbook.Sheets("Sheet1").Range("A6:B9").CopyPicture
Set vNewShape = vSlide.Shapes.Paste

' Align size and position of new shape to that of old shape
With vNewShape
.Width = vShape.Width
.Height = vShape.Height
.Left = vShape.Left
.Top = vShape.Top
End With

' Delete original shape, rename new shape to original so code works next replace cycle
vSlide.Shapes(vShapeName).Delete
vNewShape.Name = vShapeName

End Sub





share|improve this answer
























  • This is perfect!!!! Works like a charm... Thank you very much!!!

    – Rodrigo Kroehn
    Nov 23 '18 at 18:12














0












0








0







This example (based on your code) may point you in the right direction. You need to know the powerpoint shape name (which you can get via VBA or via the ribbon Home-Select-Selection Pane.



Option Explicit

Public Sub UpdateShapes()

Dim vPowerPoint As PowerPoint.Application
Dim vPresentation As Presentation
Dim vSlide As Slide

Dim vShapeName As String
Dim vShape, vNewShape

Set vPowerPoint = New PowerPoint.Application
vPowerPoint.Visible = True

' Open the powerpoint presentation
Set vPresentation = vPowerPoint.Presentations.Open("\network_folderpresentation.pptm")

' Set slide to be worked on
Set vSlide = vPresentation.Slides(2)

' Set shape to (for this example) "Picture 3"
vShapeName = "Picture 3"
Set vShape = vSlide.Shapes(vShapeName)

' Copy and paste new shape (picture) of range specified
ThisWorkbook.Sheets("Sheet1").Range("A6:B9").CopyPicture
Set vNewShape = vSlide.Shapes.Paste

' Align size and position of new shape to that of old shape
With vNewShape
.Width = vShape.Width
.Height = vShape.Height
.Left = vShape.Left
.Top = vShape.Top
End With

' Delete original shape, rename new shape to original so code works next replace cycle
vSlide.Shapes(vShapeName).Delete
vNewShape.Name = vShapeName

End Sub





share|improve this answer













This example (based on your code) may point you in the right direction. You need to know the powerpoint shape name (which you can get via VBA or via the ribbon Home-Select-Selection Pane.



Option Explicit

Public Sub UpdateShapes()

Dim vPowerPoint As PowerPoint.Application
Dim vPresentation As Presentation
Dim vSlide As Slide

Dim vShapeName As String
Dim vShape, vNewShape

Set vPowerPoint = New PowerPoint.Application
vPowerPoint.Visible = True

' Open the powerpoint presentation
Set vPresentation = vPowerPoint.Presentations.Open("\network_folderpresentation.pptm")

' Set slide to be worked on
Set vSlide = vPresentation.Slides(2)

' Set shape to (for this example) "Picture 3"
vShapeName = "Picture 3"
Set vShape = vSlide.Shapes(vShapeName)

' Copy and paste new shape (picture) of range specified
ThisWorkbook.Sheets("Sheet1").Range("A6:B9").CopyPicture
Set vNewShape = vSlide.Shapes.Paste

' Align size and position of new shape to that of old shape
With vNewShape
.Width = vShape.Width
.Height = vShape.Height
.Left = vShape.Left
.Top = vShape.Top
End With

' Delete original shape, rename new shape to original so code works next replace cycle
vSlide.Shapes(vShapeName).Delete
vNewShape.Name = vShapeName

End Sub






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 2:01









Techno DabblerTechno Dabbler

408210




408210













  • This is perfect!!!! Works like a charm... Thank you very much!!!

    – Rodrigo Kroehn
    Nov 23 '18 at 18:12



















  • This is perfect!!!! Works like a charm... Thank you very much!!!

    – Rodrigo Kroehn
    Nov 23 '18 at 18:12

















This is perfect!!!! Works like a charm... Thank you very much!!!

– Rodrigo Kroehn
Nov 23 '18 at 18:12





This is perfect!!!! Works like a charm... Thank you very much!!!

– Rodrigo Kroehn
Nov 23 '18 at 18:12




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432768%2fexcel-to-update-powerpoint-presentation%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

鏡平學校

ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

Why https connections are so slow when debugging (stepping over) in Java?