+ Reply to Thread
Results 1 to 5 of 5

Can not load picture to ActiveX Image control

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Can not load picture to ActiveX Image control

    I am using a combination of Form Controls and ActiveX controls and trying to get an image to show up in an ActiveX image control.

    When I was using a ActiveX Scroll Bar and ActiveX Image control, the image would populate correctly.

    But Since the ActiveX Scroll Bar has the annoying blinking when it is OnFocus, I wanted to move the scroll bar to a form control.

    In a normal module that is controlling the Form Control Scroll Bar, I have the following.

    Please Login or Register  to view this content.
    But I get an Object Required Error (424). I know the image is generated as I can see/find it on my desktop.

    Should Image1.Picture load for an ActiveX control from a normal Module?

    Sample Attached as well.

    Thanks,
    PT
    Attached Files Attached Files
    Last edited by ptmuldoon; 04-12-2019 at 03:43 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Can not load picture to ActiveX Image control

    This issue is not the scroller control but the image format you are trying to load.

    PNG file format is not support by the image control
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Can not load picture to ActiveX Image control

    Thanks Andy.

    In the code, it may be showing trying with a PNG, as I was trying with both GIF and JPG as well, but can not get any of them to work.

    When I added Option Explicit to the top of the module, it starts to complain about Image1 not being defined as if it is a variable?

    In the sample file, I have it working with an ActiveX ScrollBar and ActiveX Spinbutton controlling the ActiveX Image control. And it similarly working in a full userform. But I can't seem to get the Form Control Scroll Bar to control it.

    On on separate note, a potential work around I found was adding a Rectangle Shape to the worksheet and using this code. But would prefer to keep it as Image Control if possible.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Can not load picture to ActiveX Image control

    The problem is the reference to the image control.
    When you use Image1 within the activex scrollbar event it references the Image within the Sheet8 object.
    When you move the code to a code module you also need to update the reference to the image control.

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Can not load picture to ActiveX Image control

    Quote Originally Posted by Andy Pope View Post
    The problem is the reference to the image control.
    When you use Image1 within the activex scrollbar event it references the Image within the Sheet8 object.
    When you move the code to a code module you also need to update the reference to the image control.
    Awesome. That works nicely now and makes complete sense and something new I just learned.

    Thanks.
    Paul

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Load picture from worksheet into ActiveX Controls Image
    By Axmed.cm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2019, 09:52 PM
  2. Load picture using image control
    By hjoemark27 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-18-2018, 09:07 AM
  3. Load picture using image control
    By hjoemark27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2018, 07:30 AM
  4. [SOLVED] Resize picture before loading it into an activex image control
    By Alex Piotto in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-14-2018, 11:34 AM
  5. Replies: 0
    Last Post: 10-31-2016, 06:37 PM
  6. Displaying and Updating Image Dynamically (ActiveX Image Control?)
    By VTHokie11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2011, 10:57 AM
  7. How to load a picture from worksheet to image control?
    By ZahraShuaib in forum Excel General
    Replies: 3
    Last Post: 07-28-2010, 03:16 AM

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