Refresh Data

D Willett
SilverLounger
Posts: 1694
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Refresh Data

Post by D Willett »

Guys

Having a Powerpoint Presentation with a pasted special excel link. I can see my data from the Excel file, I can change my data in the Excel file, but I don't see the data change in the Powerpoint unless I close the presentation and reopen it.

The presentation sits on a PC in the workshop and runs 24-7, is there any VBA written to dynamically refresh the data on the presentation that anyone knows of?

Thanks
Cheers ...

Dave.

User avatar
StuartR
Administrator
Posts: 11501
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Refresh Data

Post by StuartR »

StuartR


D Willett
SilverLounger
Posts: 1694
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Refresh Data

Post by D Willett »

Great find Stuart, I think I understand it.

Would you know if the script would need an event to fire it, such as a timer event or something?
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 71983
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Refresh Data

Post by HansV »

You'd have to run the InitializeApp macro once after opening the presentation. I think that would be enough to get the code running.
Regards,
Hans

D Willett
SilverLounger
Posts: 1694
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Refresh Data

Post by D Willett »

Ok I don't understand properly.

Created a class module (Class 1)

In (General) (Declarations) added:

Code: Select all

Public WithEvents app As Application

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
    ActivePresentation.Slides(3).Shapes(1).LinkFormat.Update
End Sub
Then created a module (Module 1)

And in (Geberal) (Declarations) added:

Code: Select all

Dim x As New Application

Sub initialiseapp()
Set x.app = Application

End Sub
Should this work when starting the presentation?
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 71983
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Refresh Data

Post by HansV »

After opening the presentation, press Alt+F8, select initializeapp and click Run.
Then start the slideshow.
Regards,
Hans

D Willett
SilverLounger
Posts: 1694
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Refresh Data

Post by D Willett »

Hmm Interesting. I have method or data not found, but at least something is happening:
ScreenHunter_254.jpg
You do not have the required permissions to view the files attached to this post.
Cheers ...

Dave.

User avatar
HansV
Administrator
Posts: 71983
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Refresh Data

Post by HansV »

Oh wait. Change the line

Code: Select all

Dim x As New Application
to

Code: Select all

Dim x As New Class1
where Class1 is the name of the class module that you created.
Regards,
Hans

D Willett
SilverLounger
Posts: 1694
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Refresh Data

Post by D Willett »

Thanks Hans, we're all there nearly. Just have to reference the correct shape index and done.

Thanks Again
Cheers ...

Dave.