Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting EnableResize = False

Hello,

I opened a new insatnce of Excel and then I put the followinf code
in the auto_open function

Sub auto_open
ActiveWindow.EnableResize = False
Exit Sub

And then I saved the file and closed it. When I tried to open
it I got a run-time error message:

Application-defined or object-defined error

Did I make something wrong. I don't want the user to be able to
resize the active window in Excel. What should I do?

Thanks,
--Bita

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Setting EnableResize = False

You want End Sub not Exit Sub.

The code should work as long as there is an active window. For instance, if
it's hidden for any reason it will fail.

--
Jim
"BIta" wrote in message
ups.com...
| Hello,
|
| I opened a new insatnce of Excel and then I put the followinf code
| in the auto_open function
|
| Sub auto_open
| ActiveWindow.EnableResize = False
| Exit Sub
|
| And then I saved the file and closed it. When I tried to open
| it I got a run-time error message:
|
| Application-defined or object-defined error
|
| Did I make something wrong. I don't want the user to be able to
| resize the active window in Excel. What should I do?
|
| Thanks,
| --Bita
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting EnableResize = False

Sorry, I meant End Sub.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Setting EnableResize = False

Oh, yeah I just remembered the reason that line fails - the window is
maximized! You have to use the WindowState property and set it to xlNormal
before you can set EnableResize.

--
Jim
"Jim Rech" wrote in message
...
| You want End Sub not Exit Sub.
|
| The code should work as long as there is an active window. For instance,
if
| it's hidden for any reason it will fail.
|
| --
| Jim
| "BIta" wrote in message
| ups.com...
|| Hello,
||
|| I opened a new insatnce of Excel and then I put the followinf code
|| in the auto_open function
||
|| Sub auto_open
|| ActiveWindow.EnableResize = False
|| Exit Sub
||
|| And then I saved the file and closed it. When I tried to open
|| it I got a run-time error message:
||
|| Application-defined or object-defined error
||
|| Did I make something wrong. I don't want the user to be able to
|| resize the active window in Excel. What should I do?
||
|| Thanks,
|| --Bita
||
|
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Setting EnableResize = False

Thanks Jim a lot. I found another way too:

Application.ActiveWorkbook.Protect Structu=True, Winodws:=True

Cheers,
--Bita

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
Setting a CheckBox Value to False The Hawk Excel Programming 5 August 15th 05 10:03 PM
Apply "EnableResize" to Application? quartz[_2_] Excel Programming 2 January 6th 05 07:14 PM
VBA Setting .Value to a date does not respect local system setting Frank_Hamersley Excel Programming 13 July 18th 04 02:51 PM
True Or False, no matter what... it still displays the false statement rocky640[_2_] Excel Programming 2 May 13th 04 04:57 PM


All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"