+ Reply to Thread
Results 1 to 5 of 5

Writing trigger events for controls embedded in forms.frame control

  1. #1
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    Writing trigger events for controls embedded in forms.frame control

    Hello All

    here the situation. I am using MSForms2.0 frame object with additional controls embedded in the frame object (by the right-click, frame object=> Edit method)

    The reason for this setup:

    -I don't want to use a userform as this is the form itself (don't want superimposed form over excel)
    -Embedding the additional controls directly into the worksheet means I can't do control tip text, where I put in instructions that appear on mouse-over)

    So I've built my lil form using a frame control and embedded additional controls into it, have my instructions that appear on mouseover.

    Problem is, how do I write a trigger event for a embedded control?
    The view code is disabled and I've tried such like
    Please Login or Register  to view this content.
    thing is, this doesn't work. If I use it for an object embedded in the worksheet, it works fine,
    Please Login or Register  to view this content.
    but not for objects embedded in the frame.

    Any pointers?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Writing trigger events for controls embedded in forms.frame control

    I am not the most proficient forms person on the forum, but you can display a userform without showing Excel. Leith Ross recently provided an example of how to do so, more or less like this:

    Create a file in NotePad and save with a .vbs extension:

    Please Login or Register  to view this content.
    In ThisWorkbook:
    Please Login or Register  to view this content.
    In the form module (presuming that ThisWorkbook.Saved = True before this happens)
    Please Login or Register  to view this content.
    The code has to be absolutely rock solid before doing this, or you'll be terminating Excel from Task manager.

    Also, if there is another Excel instance running when you run the script (locking Personal.xls), you get a notification that it’s available if the other session terminates. I haven't thought about how to suppress this.
    Last edited by shg; 07-22-2009 at 07:23 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Writing trigger events for controls embedded in forms.frame control

    That is very nifty shg.

    Also, if there is another Excel instance running when you run the script (locking Personal.xls), you get a notification that it’s available if the other session terminates. I haven't thought about how to suppress this.
    That didn't happen to me.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Writing trigger events for controls embedded in forms.frame control

    Assuming you have a Personal.xls,

    Open Excel

    Run the script, opening a hidden instance

    Close the original session.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Writing trigger events for controls embedded in forms.frame control

    Yep, done with no notification and the userform remaining open. No complaints, I think that's rather funky and I wish I had a use for it.

+ 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