Basically, I should be able select the chart in excel, run the macro, the macro will open a new instance of PowerPoint, insert a new chart (with the same chart type as the one in excel) and update the ppt chart backend data with the data from the excel chart
Hope this was clear. Any support would be appreciated!
All content I found online only suggests code for copy-pasting with (a) link to excel or (b) an embedded chart
(a) doesn't work because user should be able to edit chart
(b) doesn't work because user should not have access to full excel file and will also increase size of ppt
Apologies if I have missed an existing solution here.
Adding my sample code that can paste as well as embed...
Sub ExportSelectedChart()
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSlide As PowerPoint.Slide
Dim Chrt As ChartObject
'Set Chrt = ThisWorkbook.Sheets("Sheet1").ChartObjects(1)
If TypeName(Selection) = "ChartArea" Then
Set pptApp = New PowerPoint.Application
pptApp.Visible = True
Set pptPres = pptApp.Presentations.Add
Set pptSlide = pptPres.Slides.Add(1, ppLayoutBlank)
Set Chrt = Selection.Parent.Parent
Chrt.Copy
'Pastes Chart - But linked to source excel
'PPTSlide.Shapes.Paste
'Pastes Embedded Chart - But includes full excel file and size
pptApp.CommandBars.ExecuteMso ("PasteExcelChartSourceFormatting")
Else
MsgBox "Please select a chart in Excel before running this macro.", vbExclamation
End If
End Sub