Can anyone point me to an example of how to prevent the workbook from being resized when opened ?
My project has a set dimension for functionality.
Thank you !
Can anyone point me to an example of how to prevent the workbook from being resized when opened ?
My project has a set dimension for functionality.
Thank you !
Hi there,
Try inserting the following code into the ThisWorkbook VBA CodeModule of your workbook and see if it does what you need:
The highlighted values can be altered to suit your own requirements.Please Login or Register to view this content.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Greg
The code sets the workbook to the correct size but doesn't stop anyone from resizing the window or the workbook manually.
I've done alot of searching today for something that will "freeze" the workbook/window ... no luck.
You could try protecting the structure of the workbook with a password.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Hi again,
Many thanks for your feedback.
Does the following code help? It doesn't prevent a User from resizing the window manually, but it undoes his/her resizing immediately afterwards.
As before, the code should be inserted in the ThisWorkbook VBA CodeModule.
Alter these values to suit your requirements.Please Login or Register to view this content.
Hope this helps - as always, please let me know how you get on.
Regards,
Greg M
Hey Greg:
It works great on the worksheet but the Main Workbook is still resizable.
Is there a means of applying that code to the WorkBook instead of the WorkSheet ?
Thank you.
Have you looked at the Workbook_WindowResize event in the ThisWorkbook code module?
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Im still learning.
What should I do with
I believe you may be referring to a change in the syntax but I'm not certain how to proceed.Please Login or Register to view this content.
Hi again,
I'm not really sure what you mean by:
It works great on the worksheet but the Main Workbook is still resizable.
When I open the workbook I can drag the corners/edges of the Excel window to resize it, but as soon as I release the mouse button the VBA code immediately resets the window to the dimensions specified in the code.
Regards,
Greg M
It doesn't work that way for me. I'm probably using the wrong terms but I'll try to explain what occurs on my system.
Excel has the main window or workbook. Then within that main frame is another window or the "sheet" that you work with. The sheet resizes back to its original dimensions, but the main window/workbook can still be expanded in any direction. It does not shrink back.
Is there a way to ammend the code so the main window automatically resizes as well ?
Or - should the code as presented, already do that ? If so, I wonder what is going on with my system.
Hi again,
Sorry about the delay in getting back to you.
I'm running Windows 7 and Office 2013.
I don't have a "frame within a frame" representing the worksheet, just an overall window (on the Desktop) for the Excel application. As mentioned previously, if the User tries to resize the overall window, the VBA code will reset the dimensions of that window to those specified in the code.
Regards,
Greg M
Two different things in play here.
... the application ie: Excel, which has the bigger X in upper right corner of the Excel application window
... the application document ie: the workbook, which has a smaller X, below the other, inside the application window
Perhaps Andrew Poulsom's posts #6 & #10 in this discussion will be of use.
The thread here looks to have similar issues to what you currently have. I found the last post very telling as to who would know how to handle things.
And that leads to this and this, unfortunately the file link is ancient.
Hope this posts, been getting Server too busy, try again later all day.
posted twice
NoSparks:
Thank you for digging up this information. I marvel how you are able to locate these things.
See ya friend !
GregM:
Thank you for your assistance. I'm using Excel 2007 and Win 10.
Have a great day !
Last edited by Logit; 10-07-2016 at 07:10 AM. Reason: addition
Hi again,
Many thanks for all of your feedback and also for the Reputation increase - much appreciated
Confusion cleared - Excel 2013 doesn't have a Minimize Workbook "X" button, just a Minimize Application "X" button.
Best regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks