+ Reply to Thread
Results 1 to 6 of 6

VBA to lock a workbook to a certain width and height

  1. #1
    Forum Contributor
    Join Date
    06-07-2014
    Posts
    209

    VBA to lock a workbook to a certain width and height

    After searching for 2 hours online, I have read virtually most of the articles and have come to the conclusion that it may be impossible to lock an Excel workbook to a certain window size.

    What I am trying to do is drag the bottom right corner of a workbook window to a desired width and height, and punch in some VBA code [may require API calls] and the outcome I desire is to have that window locked to that size and prevent other users from resizing it.

    If there is a solution to this, then you walk in the pathways of the righteous Excel beings.

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

    Re: VBA to lock a workbook to a certain width and height

    Why?

    People get touchy when you modify their environment.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    06-07-2014
    Posts
    209

    Re: VBA to lock a workbook to a certain width and height

    Thanks for your reply. Well, I can achieve the specific sizing if I were to use a userform for an item that I am working however I am using a worksheet in a workbook and my 'app' interface occupies an area of A1:K31. On opening the file I wanted the viewable area to only be the range of my app as it already looks like an app and prevent users from resizing it because it will lose its 'appiness' look.

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

    Re: VBA to lock a workbook to a certain width and height

    Would it not be sufficient to set the scroll area?

  5. #5
    Forum Contributor
    Join Date
    06-07-2014
    Posts
    209

    Re: VBA to lock a workbook to a certain width and height

    I tried this but it doesn't work with what I want to achieve. Maybe this is one of the things VBA and Excel cannot do.

  6. #6
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to lock a workbook to a certain width and height

    I expect it can, but it will surely require API. There is no Application.Resize event like there is for forms.

+ 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. How to lock cell width and height for an entire worksheet
    By vaughnahue in forum Excel General
    Replies: 4
    Last Post: 05-31-2018, 10:14 AM
  2. I Want to Set my excel workbook window Width =, Height =
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2014, 12:35 AM
  3. [SOLVED] lock up height & width of the rows and columns?
    By manharji in forum Excel General
    Replies: 0
    Last Post: 07-29-2010, 10:28 PM
  4. [SOLVED] Is it possible to lock the height and width of a cell?
    By Kilgus in forum Excel General
    Replies: 1
    Last Post: 07-19-2005, 04:05 PM
  5. [SOLVED] Determining the height and width of Print_Area in a closed workbook
    By dave.cuthill@computalog.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2005, 09:11 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