+ Reply to Thread
Results 1 to 5 of 5

Click code for ActiveX control doesn't run in second Window

  1. #1
    Registered User
    Join Date
    06-09-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Click code for ActiveX control doesn't run in second Window

    Hello,
    I have a complex woorksheet that contains a lot of images, and each image runs a macro when it is clicked. I need to be able to see multiple parts of the worksheet at once, so I create a second window by clicking New Window in the View ribbon.

    However, the click functionality of each image is only available in one window. The other window of the same worksheet, has the click functionality disabled.

    I create the click functionality by adding a function for each image, for example:

    Please Login or Register  to view this content.
    This code is located in the code for the worksheet. When the image control that I have named imgPltte_7 is clicked, the procedure moveFabric is called with a string parameter.

    Does anybody know how to make the click functionality available in both windows viewing the same worksheet?

    Thanks!
    Owen
    Last edited by owenf; 06-10-2013 at 12:45 PM. Reason: Added Code Tags

  2. #2
    Registered User
    Join Date
    06-09-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Click events in second window of same worksheet.

    Hello, since there is no answer to this, I thought I would try to clarify the problem by offering steps that will re-create it.

    1) In a new workbook, in the Developer ribbon, click Insert-->Image (ActiveX Control)
    2) Drag to create a small image.
    3) right-click the new image and select View Code.
    4) Add a simple message box to the code. Here is an example:
    Please Login or Register  to view this content.
    5) Return to the workbook. Turn off Design Mode by clicking Design Mode.
    6) Click on the image: a message box appears. Click OK.
    7) Click View to open the View ribbon. Click New Window. A new window opens.
    8) Now click on the image in the new window. Nothing happens. I need both windows to run the activeX control's code when it is clicked in either window.

    Thanks!
    Owen
    Last edited by owenf; 06-10-2013 at 12:47 PM.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Click code for ActiveX control doesn't run in second Window

    Owen

    Instead of New Window have you tried Split, or would that not be suitable?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    06-09-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Click code for ActiveX control doesn't run in second Window

    Hello Norie,

    Good suggestion, but Split doesn't suffice. If you split horizontally, then the horizontal scroll is shared between the two areas, and I need to see stuff way out on the right and left simultaneously, as well as stuff up and down. If you split horizontally and vertically, to get independent vertical scroll bars, then half the screen real-estate is compromised because only two of the four quadrants is useful.

    Thanks,
    Owen

  5. #5
    Registered User
    Join Date
    06-09-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Click code for ActiveX control doesn't run in second Window

    sampleXLSM.xlsm

    It's a bummer that nobody has been able to shed some light on this; perhaps it is a lost cause. I have posted a sample workbook.

    To recreate the problem, just open it, and then click View, and New Window. Observer that in the original window, the image macro works, and in the second it does not. How can I get it to work in the second window?

    Thanks in advance for any help,
    Desperately, Owen

+ 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