+ Reply to Thread
Results 1 to 26 of 26

Scrolling credits on a user form?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Scrolling credits on a user form?

    I am still learning user forms so please excuse any mistakes.

    I would like to make scrolling credits appear on a user form. I did find one solution on the net but it didn't scroll smoothly.

    I wondered if it would be somehow possible to link a scroll bar (set to Visible = False) to a user form object and then use application.ontime (upon initialize) to slowly scroll the words up the form?

    Or is this just wishful thinking on my part?
    Last edited by mc84excel; 06-06-2013 at 10:47 PM. Reason: Alter thread title to reflect the alternative solution used
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    it would be helpful if you indicated what you had tried

    you could try adding a label to the form positioned out of sight by setting the Height of the form less than its scrollheight and then just increment the Scrolltop in a loop
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Sorry Joseph, I am still learning user forms and haven't actually started creating the scrolling credits yet. I thought I'd ask the forum users in case they had any suggestions/tips to share. (or the remote possibility that someone has already created this code?)

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by mc84excel View Post
    I did find one solution on the net but it didn't scroll smoothly.
    what was this solution? no point suggesting the same!

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by JosephP View Post
    what was this solution? no point suggesting the same!
    I'm sorry. Again I not make myself clear and cause confusion

    Basically it was supposed to provide scrolling credits but it didn't do this by means of a scroll bar. It had a few labels on the user form and moved the values in these up every few seconds (i.e. so Label 1 would contain Label2s contents, Label2 would contain Label3s etc. It would then shift the values up again and so on). I imagine this would look extremely jerky.
    Last edited by mc84excel; 06-04-2013 at 01:50 AM. Reason: clarify

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by mc84excel View Post
    I imagine this would look extremely jerky.
    so you did not actually test it??

    btw I already made a suggestion ;-)

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by JosephP View Post
    so you did not actually test it??

    btw I already made a suggestion ;-)
    Well no. That may sound a little naive but I didn't bother testing it for two reasons:
    1. I have already seen the same concept at work in another (non-VBA) program. The lines don't scroll up, they "skip and jump" all the way up
    2. There were a few comments on the web page (where I saw this code) complaining about how jerky it looked in action

    I will try out your suggestion soon
    Last edited by mc84excel; 06-04-2013 at 11:54 PM.

  8. #8
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Sounds like PowerPoint item to me.

  9. #9
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Yes it would look absolutely horrible.

    That's why I was thinking of an invisible scroll bar. From the end users view, they would see the developers names smoothly slide up the screen. Sweet.

  10. #10
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by JosephP View Post
    try adding a label to the form positioned out of sight by setting the Height of the form less than its scrollheight and then just increment the Scrolltop in a loop
    I'm just trying out your suggestion now and came unstuck rapidly. (I am still new at User Forms).

    I know how to set the height of a form and of a label but what is a labels ScrollHeight? I can't find in the Label properties. Also I don't know what the Scrolltop is.

    I have added a ScrollBar to the form. How do I link this to the label so that moving the scroll bar moves the label?
    Attached Files Attached Files

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    the devil makes work for idle hands so here is a sample ;-)
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Here's another slightly different approach, but builds on JP's example.

    abousetta
    Attached Files Attached Files
    Last edited by abousetta; 06-05-2013 at 07:24 AM.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  13. #13
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    nice alternative :-)

    shouldn't really use PtrSafe without a test for #VBA7 though

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Sorry, forgot to change that in the example. I am using office 64, but I know most people use 32. I'll update the example.

  15. #15
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Wow! Brilliant work JosephP and abousetta! +1 each The outcome of the two XLSMs was exactly what I had in mind.

    The only question I have is the use of kernel32.dll - could this cause any incompatibility issues?


    @ JosephP - you understand latin?!
    @ abousetta - nice touch having the form close at the end.
    Last edited by mc84excel; 06-06-2013 at 09:16 PM.

  16. #16
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    It sure could if any of your users have a Mac.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  17. #17
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    Quote Originally Posted by mikerickson View Post
    It sure could if any of your users have a Mac.
    I was thinking of Excel 64 bit users.

  18. #18
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits using a non-visible scroll bar on a user form?

    I have copied the code to the XLSM I want to use it in but I have discovered a few unexpected problems. If a user closes the form before it finishes scrolling, all of the macro keyboard shortcuts stop working and the save icon is grayed out.

    Any ideas how to fix this? (Short of preventing the form close button from working)?


    Will kernel32.dll work for Excel 64 bit users?
    Last edited by mc84excel; 06-06-2013 at 09:28 PM. Reason: used wrong reference

  19. #19
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scrolling credits on a user form?

    Here you can find MS's description of the problem and solution. Simply put, in this case you can:

    replace:
    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.
    abousetta

    P.S. This is replying to post #17. If you want us to look at the problems described in post #18 then upload a file.
    Last edited by abousetta; 06-07-2013 at 12:37 AM.

  20. #20
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits on a user form?

    Thanks!

    See attached.

    How to test:
    1. Press Ctrl + Shift + T. Shortcuts are working
    2. Use the test button to bring up the smoothly scrolling credits
    3. Before the credits end, close the form
    4. Now press Ctrl + Shift + T.
    5. Result = the macro shortcuts refuse to respond
    Attached Files Attached Files

  21. #21
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits on a user form?

    don't let them close the form then ;-)

  22. #22
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits on a user form?

    In the meantime I have added code so that the users cant close the form. However I would like the end user to be able to close the form without having to sit through the credits. Is there any way to stop the kernel32 processing the scroll on form close?

  23. #23
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scrolling credits on a user form?

    Add a button on the userform and call it Button1

    Repace the code in the userform with this:
    Please Login or Register  to view this content.
    Replace the code in the standard module with this code:
    Please Login or Register  to view this content.
    I should note that this is all untested but should work.

    abousetta

  24. #24
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Talking Re: Scrolling credits on a user form?

    I managed to work out how to stop the code when exiting the form. abousetta gave me the clue.

    Code below:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mc84excel; 06-10-2013 at 11:30 PM.

  25. #25
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Scrolling credits on a user form?

    I'd add a checkbox so that after the first time the credits don't get shown again

    (actually I wouldn't do this in the first place but that's me)

  26. #26
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Scrolling credits on a user form?

    Not a bad idea however I set it up so that the credits are only shown if the user selects the Credits button on a UserForm, so I'll probably leave it as is. (I just wanted the end user to have the ability to exit the credits early if they get bored )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1