PDA

View Full Version : Not update Excel.sheet.12 in Powerpoint VBA



markuik
01-30-2013, 10:20 AM
Hi,

I edit data from a graph (Excel.sheet.12) in a presentation in VBA, charts seems to be updated, but when I do double click on it, graph changes to initial values.

Pleas could anybody help me?

I attach you VBA code:

If (.Shapes(s).Name = "Grafico2") Then
Set oSh = .Shapes(s)
With oSh.OLEFormat.Object.Worksheets(1)

.Range("B2").Value = newxls.Sheets("Temporal").Cells(1, 3).Value / 100
.Range("B3").Value = newxls.Sheets("Temporal").Cells(2, 3).Value / 100
.Range("B4").Value = newxls.Sheets("Temporal").Cells(3, 3).Value / 100
.Range("B5").Value = newxls.Sheets("Temporal").Cells(4, 3).Value / 100
.Range("B6").Value = newxls.Sheets("Temporal").Cells(5, 3).Value / 100
.Range("B7").Value = newxls.Sheets("Temporal").Cells(6, 3).Value / 100
.Range("B8").Value = newxls.Sheets("Temporal").Cells(7, 3).Value / 100

.Range("A2").Value = newxls.Sheets("Temporal").Cells(1, 1).Value
.Range("A3").Value = newxls.Sheets("Temporal").Cells(2, 1).Value
.Range("A4").Value = newxls.Sheets("Temporal").Cells(3, 1).Value
.Range("A5").Value = newxls.Sheets("Temporal").Cells(4, 1).Value
.Range("A6").Value = newxls.Sheets("Temporal").Cells(5, 1).Value
.Range("A7").Value = newxls.Sheets("Temporal").Cells(6, 1).Value
.Range("A8").Value = newxls.Sheets("Temporal").Cells(7, 1).Value
End With
Set oSh = Nothing
End If

Thanks,
Marcos

John Wilson
01-30-2013, 12:29 PM
You probably need to say what version of PPT and how the chart was created.

You might try adding this after you change the values and befor Seo oSh=Nothing

oSh.OLEFormat.Application.Update
oSh.OLEFormat.Application.Quit

(Not tested!)