+ Reply to Thread
Results 1 to 5 of 5

preventing userform movement

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    Miami. OK
    MS-Off Ver
    Excel 2003
    Posts
    23

    preventing userform movement

    Is it possible to prevent a user from being able to move a userform around the screen area (clicking and holding caption bar)? I am captureing a image and using Pixels coordinates on the capture and need the userform to stay in the center of the screen or the image will not be catptured.

    The StartupPosition is center of screen, tried
    Please Login or Register  to view this content.
    to force it back to center screen if moved but get Invalid Quilifier for startupposition.
    Last edited by mhill; 12-04-2009 at 05:40 PM.

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

    Re: preventing userform movement

    cheap and cheerful code

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-06-2009
    Location
    Miami. OK
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: preventing userform movement

    thank you Andy, works like a charm.

  4. #4
    Registered User
    Join Date
    05-06-2013
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: preventing userform movement

    Hi Andy,

    in what module do I have to place your code below to reposition a moved user form. I tried it out with userform1 in worksheet 1 but it didn't work (I was able to move the form and it did not move back into the original position). My understanding is that the script works on any userform in any sheet that i touched or ?

    PS. It seems that my VBA 2007 does not know the commands Me.Left, me.top, me.move but maybe I placed it in the wrong module?

    Thanks for you help !

    Thomas


    **************
    Please Login or Register  to view this content.
    **************
    Last edited by arlu1201; 05-07-2013 at 02:27 AM.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: preventing userform movement

    kle,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

    Also,

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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