PDA

View Full Version : Scrollbars in Powerpoint to Manipulate Embedded Excel SS



houstonastro
05-26-2006, 06:34 PM
I have an embedded excel spreadsheet in power point. I want to manipulate cells in the embedded excel spreadsheet with scroll bars in powerpoint. The red scrollbar appears to work fine (it changes number in red cell), but the green scroll bar (changes number in green cell) is not working properly.

Try moving the green scroll bar a few times after you have moved the red scroll bar. File is attached.

Could someone suggest what is wrong with the code?

Thanks in advance for your help

Killian
05-27-2006, 07:21 AM
Hi and welcome to VBAX :hi:

Having got your reference to the embedded sheet, you can just apply the scrollbar value to the appropriate cellPrivate Sub ScrollBar1_Change()

Dim objDataSheet As Object

Set objDataSheet = Me.Shapes(2).OLEFormat.Object
objDataSheet.Worksheets(1).Cells(1, 1) = ScrollBar1.Value
Set objDataSheet = Nothing

End Sub

Private Sub ScrollBar2_Change()

Dim objDataSheet2 As Object

Set objDataSheet2 = Me.Shapes(2).OLEFormat.Object
objDataSheet2.Worksheets(1).Cells(2, 1) = ScrollBar2.Value
Set objDataSheet2 = Nothing

End Sub