0

I'm trying to run a macro from an Excel book to automate a chart update in powerpoint. It is going to reseat the source range of a chart I have created. I am doing this to then generate the same chart a number of times, each time with a different source, into separate slides. Both the source Excel and the target powerpoint are always open.

I can't seem to see my mistake here, I am following the documentation but still getting an error.

Sub ThinkcellMacro() 'early bound ppt Dim pptApp As PowerPoint.Application Dim pptPres As PowerPoint.Presentation Set pptApp = GetObject(, "PowerPoint.Application") Set pptPres = pptApp.Presentations("Powerpointpresentation.pptx") 'thinkcell Dim tcaddin As Object Set tcaddin = pptApp.COMAddIns("thinkcell.addin").Object 'Set tcaddin = pptApp.COMAddIns("think-cell") Dim srcWB As Workbook Set srcWB = Workbooks("FileSource.xlsx") Dim srcSHT As Worksheet Set srcSHT = srcWB.Sheets("Sheet") Dim dataRange As Range Set dataRange = srcSHT.Range("A516") Call tcaddin.UpdateChart(pptPres.Slides(1), _ "Waterfall", dataRange, False) End Sub 
4
  • 1
    Not sure if this is related to your problem (I don't have the AddIn), but your dataRange contains only one cell ("A516"). I don't think you can create a chart from that. Commented Jul 23 at 10:10
  • You may try to pass the presentation and not the slide in the .UpdateChart call (like shown in the example in the documentation) Commented Jul 23 at 12:02
  • What line causes the error? What's the error message? Commented Jul 24 at 15:27
  • "Not sure if this is related to your problem (I don't have the AddIn), but your dataRange contains only one cell ("A516")." >>Just an example. Issue persists when the range is set correctly "You may try to pass the presentation" >> Same error, also this i want to avoid because the presentation will consist of multiple visuals "What line causes the error? What's the error message?" >> This line: Call tcaddin.UpdateChart(pptPres.Slides(1), _ "Waterfall", dataRange, False) The error is: Run-time error '438': Object doesn't support this property or method Commented Jul 28 at 8:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.