Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Freezing the Size of the Window (Excel 97 and >)

    Folks

    Is there a way I can prevent the user from resizing my application window? I know how to remove the Close and Min|Max buttons via API but the user can still drag and resize the window via the mouse.

    TIA

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Freezing the Size of the Window (Excel 97 and >)

    Use Workbook protection, and make sure that Windows is ticked. Before applying th eprotection, set the windows the way you want, i.e. maximised, restored etc.

    Andrew C

  3. #3
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Freezing the Size of the Window (Excel 97 and >)

    Hi Andrew

    Sorry I should have been more specific and its not the workbook window that I need, its the Excel application while running my workbook application.

    Thanks

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Freezing the Size of the Window (Excel 97 and >)

    Is you application window maximised ?

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Freezing the Size of the Window (Excel 97 and >)

    Yes No and could be.

    I can always issue the Application.WindowState =xlMaximized in my code if need be. But I actually need it to be the size of 8 columns by 26 rows on a 1024x768 screen resolution or there abouts.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  6. #6
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Freezing the Size of the Window (Excel 97 and >)

    Wassim,

    Without having read it in great detail, this link might get you some good ideas.

    http://www.cpearson.com/excel/zoom.htm#center

  7. #7
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Freezing the Size of the Window (Excel 97 and >)

    I fiddled just a little with this and wrote some API code to stop moving/resizing, but there is no place to put it: the only reasonable event is Workbook_WindowResize, but that dosn't fire when the app window is resized (go figure!). I don't have the code on this machine, but the API calls were FindWindow("XLMAIN", Applicatio.Caption) to get the window handle and SetWindowPosition(hWnd,HWND_TOP,0,0,0,0,SWP_NOSIZE +SWP_NOMOVE). Sorry, I can't do this one. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •