joshcas
07-16-2013, 02:03 PM
Hi,
Today I知 trying to create a function that will export whatever I selected to powerpoint and I found a code on the web that works really well because it allows me to edit the data in powerpoint however the flaw is that is not copying the charts on the selection ,I知 really novice on exporting commands so I値l really appreciate your help .
'Dim pptApp As PowerPoint.Application
Dim pptApp As Object
'Dim pptPres As PowerPoint.Presentation
Dim pptPres As Object
Dim myRange As Excel.Range
Set myRange = Selection
'Worksheets("US").Range ("F1:AB31")
Set pptApp = GetObject(Class:="PowerPoint.Application")
Set pptPres = pptApp.ActivePresentation
' Dim ppPrez As Object
'
'Set ppPrez = pptApp.Presentations.Add
myRange.Copy
pptPres.Windows(1).Activate
pptPres.Windows(1).View.GotoSlide 3
pptApp.CommandBars.ExecuteMso ("PasteSourceFormatting")
End Sub
Today I知 trying to create a function that will export whatever I selected to powerpoint and I found a code on the web that works really well because it allows me to edit the data in powerpoint however the flaw is that is not copying the charts on the selection ,I知 really novice on exporting commands so I値l really appreciate your help .
'Dim pptApp As PowerPoint.Application
Dim pptApp As Object
'Dim pptPres As PowerPoint.Presentation
Dim pptPres As Object
Dim myRange As Excel.Range
Set myRange = Selection
'Worksheets("US").Range ("F1:AB31")
Set pptApp = GetObject(Class:="PowerPoint.Application")
Set pptPres = pptApp.ActivePresentation
' Dim ppPrez As Object
'
'Set ppPrez = pptApp.Presentations.Add
myRange.Copy
pptPres.Windows(1).Activate
pptPres.Windows(1).View.GotoSlide 3
pptApp.CommandBars.ExecuteMso ("PasteSourceFormatting")
End Sub