• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA automatic slider

Hi Everyone,

I have created a userform...normal userform with some textboxes and buttons....Now on the upper part of it I want to place few pictures that should slide automatically....Not sure if there is a way to do this in VBA... Please suggest..

Thansk and Regards,
Sandy
 
Thanks Syedali and Chihiro for quick help....

Chihiro...I used your code and it is working fine but I need automatic slider....without pressing Next button or previous button....pictures should keep changing on a certain interval of time....

Is there any way?
 
Search Application.OnTime and you will find examples of how this can be used to automatically run code at interval.

In this instance, you'd emulate clicking "Next" (i.e. CommandButton2_Click).
 
Chihiro...I have found this code...but not able to place it in your code.....can you please help...

Dim t

Sub M_snb_ontime_start()
MsgBox "illustration"

t = DateAdd("s", 5, Time)
Application.OnTime t, "M_snb_ontime_starten"
End Sub

Sub M_snb_ontime_sluiten()
Application.OnTime t, "M_snb_ontime_start", , False
End Sub
 
I'll need to know how you intend to use the form.

Is it just to show images in a given folder at 5 sec interval and exit the form? Or should the form remain open? What's the expected behavior when code reaches last image? etc etc...

Without full scope of your requirement. It's pretty hard to give you solution that you are looking for.
 
I have a userform with other controls....this part of it is there to give the userform a fancy view.....here is what I intend to do...
I want images to keep sliding every 5 sec from the time userform is shown/initialized till the time userform is open.....when we have last image in the folder it should again show the first image so the sequence will be .....1...2...3...4....1.....2....3...4 and so on...
Hope I am able to clear my question/query..
 
I can't think of clean way to do it.

It may be better to create slideshow in PowerPoint and then play the slide show in Userform if you want fancy animation.
 
Back
Top