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?
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]