PowerPoint VBA updating embedded object with data from excel not holding the changes

mooseman

Board Regular
Joined
Jul 23, 2004
Messages
195
Office 2016 Pro Plus and Windows 7
I have this code that updates the data in a standard embedded excel object (not a chart) and when the code runs the object shows the change, but if I save the file and then open it,as soon as I double click the object to activate it, the data all disappears. I can run a sub that opens and closes the Embedded object, but that takes over the computer (opening another instance of Excel each time).


Does anyone else have this problem or know what is wrong?
Code:
[COLOR=#333333][FONT=Courier]Sub Slide_16(xlWorkBook, company, lDate) ' I bring in the workbook object and two text variables[/FONT][/COLOR]
[COLOR=#333333][FONT=Courier]
For Each oSH In ActivePresentation.Slides(1).Shapes
        Select Case oSH.Name   'find the objects by the name I have given them
            Case "Top_Item_16"
              lrow = xlWorkBook.Worksheets(2).Range("B1").CurrentRegion.Rows.Count   'finds last row of data



            [B]  oSH.OLEFormat.Object.sheets(1).Range("A2:L" & lrow).Value = xlWorkBook.sheets(2).Range("A2:L" & lrow).Value  [/B]                


            Case "Footer"  'This is just a text box
                message = "Source:database- " & company & " " & lDate & " Confidential"
                               oSH.TextFrame.WordWrap = msoFalse
                                oSH.TextFrame.AutoSize = ppAutoSizeShapeToFitText
                                oSH.TextFrame.TextRange.Text = message
         End Select

Next oSH

End Sub[/FONT][/COLOR]
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,632
Messages
6,173,472
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top