Excel to update PowerPoint Presentation
up vote
0
down vote
favorite
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
add a comment |
up vote
0
down vote
favorite
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
I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.
– Pᴇʜ
Nov 22 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 at 18:39
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
@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 at 7:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
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
excel vba excel-vba powerpoint powerpoint-vba
edited Nov 22 at 14:11
Pᴇʜ
19.9k42650
19.9k42650
asked Nov 22 at 14:08
Rodrigo 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 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 at 18:39
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
@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 at 7:03
add a comment |
I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.
– Pᴇʜ
Nov 22 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 at 18:39
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
@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 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 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 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 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 at 18:39
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
@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 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 at 7:03
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
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
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
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
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
add a comment |
up vote
0
down vote
accepted
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
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
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
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
answered Nov 23 at 2:01
Techno Dabbler
33327
33327
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
add a comment |
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
This is perfect!!!! Works like a charm... Thank you very much!!!
– Rodrigo Kroehn
Nov 23 at 18:12
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
I suggest Automatic Updating of Excel Tables in PowerPoint Slides. So you don't have to update your presentation manually.
– Pᴇʜ
Nov 22 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 at 18:39
Hey Rodrigo. May I suggest an alternative without coding: With SlideFab 2 lite (slidefab.com) you can do this for free: You create a template presentation with a shape that is supposed to be replaced with the screenshot. Then in SlideFab 2 you can connect this shape to the range in Excel for the screenshot. And select "screenshot" as export mode. Then you click "Start making slides" and it will copy all specified elements (also tables, shapes, graphs, etc.) from Excel to Powerpoint. Shouldn't take more than a couple of minutes to set this up. If sth. unclear, pls ask. Cheers. Jens
– Jens.Huehn_at_SlideFab.com
Nov 23 at 7:02
@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 at 7:03