Closed Thread
Results 1 to 11 of 11

vba web control gif image disappearing when changing tab on multipage

  1. #1
    Registered User
    Join Date
    10-15-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    49

    vba web control gif image disappearing when changing tab on multipage

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hello,

    I have this formula input on userform initialize and its loading my web controls great with gif images.

    They are placed on separate tabs on a multipage object with tabs.

    However, if I leave a tab and then go back to it.. my image is now gone.

    Any ideas why or can someone tell me where to put code to refresh them?

    Kind Regards,

    KAZ

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: vba web control gif image disappearing when changing tab on multipage

    Hello ExcelGal ,

    Are these files on your local disk?
    What type of control are these pictures being loaded into?

    There is a lot going on in this UserForm. It would be helpful if you uploaded a copy of the workbook.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-15-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: vba web control gif image disappearing when changing tab on multipage

    Hi,

    Thanks for the reply.

    Yes the images are saved on my hard drive.

    They are being loaded into a microsoft web control found in additional tools when right clicking on toolbox.

    The excel form picks them up as long as they are in the same directory and called web1.gif and web2.gif

    I have deleted all stuff not needed from my project as to provide a sample.

    Please find attached a sample. Form is called frmmain

    web1.gif can be downloaded here https://dl.dropbox.com/u/80622831/web1.gif
    web2.gif can be downloaded here https://dl.dropbox.com/u/80622831/web2.gif

    From doing a search online I couldn't find a solution. I thought it would be as simple as putting it on tab activate or something but I didn't know if that was available.

    Thanks
    Kaz
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: vba web control gif image disappearing when changing tab on multipage

    Hello ExcelGal,

    After doing a lot of testing, I am pretty well convinced this is a bug in the WebBrowser object. I need to research this object for this problem before I can definitely say it is a bug.

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: vba web control gif image disappearing when changing tab on multipage

    It is, you can't toggle the visibility of the webbrowser object, in the past I've used a workaround of tabstrip and moving the control off the form to the right.

    I've,never been able to make the control work either in tabs or by changing visibility

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

    Re: vba web control gif image disappearing when changing tab on multipage

    multipage controls don't always work well with controls that are not from the Forms library (eg calendar control or refedit)
    Josie

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

  7. #7
    Registered User
    Join Date
    10-15-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: vba web control gif image disappearing when changing tab on multipage

    Thanks for the replies guys..

    I think the same.. my aim was to display gif images. Is there another way to display with gif images not using a web browser control?

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: vba web control gif image disappearing when changing tab on multipage

    Do you need them to be animated? If not the Picture control works fine for me

  9. #9
    Registered User
    Join Date
    10-15-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: vba web control gif image disappearing when changing tab on multipage

    I want them to be animated and transparent or the same back colour as userform like in example attached above.

    When the form is initialized it loads of web control... Is there code to unload the control? And then in a piece of code.. I could unload the control and load it again as if it is being initialised again.

    That way I'll just add it to some of my buttons on the form.

    This loads it.. but if I use this code again I get an error and im assuming cause it's already loaded. I want to maybe unload it and load it again if thats possible

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Kind Regards

    ---------- Post added at 08:14 AM ---------- Previous post was at 06:22 AM ----------

    I managed to fix this to get it to do what I wanted.

    Instead of having the gif images on the form. I positioned them exactly where they needed to be behind the form and then grouped them with the form so they stayed in the correct place.

    I then used this code to bring the position of the images back and forward to the correct place on the right tab.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-14-2022
    Location
    Spain
    MS-Off Ver
    2019
    Posts
    1

    Re: vba web control gif image disappearing when changing tab on multipage

    Can you upload your work? I need to see how you did. I have a multipage with several tabs. In the first tab that is seen when I launch the form, I have a working gif. But when I move to the next tab and back to the first tab, the gif doesn't work anymore.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,231

    Re: vba web control gif image disappearing when changing tab on multipage

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. In this case, the thread is very old, and it is therefore much better to start afresh.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed 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