Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following function which generates "Object defined" error (please
correct for line wrapping): Public Function LockWindowSize(argLock As Boolean) If argLock = True Then ActiveWindow.EnableResize = False Else ActiveWindow.EnableResize = True End Function Can someone fix this for me? I am attempting to disable the currently active window from being resized. Thanks much in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm...it works for me. How are you calling it?
Note that you can make it a bit shorter: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function In article , quartz wrote: I have the following function which generates "Object defined" error (please correct for line wrapping): Public Function LockWindowSize(argLock As Boolean) If argLock = True Then ActiveWindow.EnableResize = False Else ActiveWindow.EnableResize = True End Function Can someone fix this for me? I am attempting to disable the currently active window from being resized. Thanks much in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I switched to yours as follows:
Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function I call it as follows: Call LockWindowSize(True) That is all I have in a "Test" subroutine. And I still get the error (Application defined or object defined error) and the "ActiveWindow.EnableResize" line is highlighted. Any ideas? I get the same error when running either from the VBE or from the worksheet. "JE McGimpsey" wrote: Hmmm...it works for me. How are you calling it? Note that you can make it a bit shorter: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function In article , quartz wrote: I have the following function which generates "Object defined" error (please correct for line wrapping): Public Function LockWindowSize(argLock As Boolean) If argLock = True Then ActiveWindow.EnableResize = False Else ActiveWindow.EnableResize = True End Function Can someone fix this for me? I am attempting to disable the currently active window from being resized. Thanks much in advance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get that error if the Window is maximized. Make sure you window is not
maximized. (also, I assume the workbook is not protected). -- Regards, Tom Ogilvy "quartz" wrote in message ... I switched to yours as follows: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function I call it as follows: Call LockWindowSize(True) That is all I have in a "Test" subroutine. And I still get the error (Application defined or object defined error) and the "ActiveWindow.EnableResize" line is highlighted. Any ideas? I get the same error when running either from the VBE or from the worksheet. "JE McGimpsey" wrote: Hmmm...it works for me. How are you calling it? Note that you can make it a bit shorter: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function In article , quartz wrote: I have the following function which generates "Object defined" error (please correct for line wrapping): Public Function LockWindowSize(argLock As Boolean) If argLock = True Then ActiveWindow.EnableResize = False Else ActiveWindow.EnableResize = True End Function Can someone fix this for me? I am attempting to disable the currently active window from being resized. Thanks much in advance. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's it! Thanks!
"Tom Ogilvy" wrote: I get that error if the Window is maximized. Make sure you window is not maximized. (also, I assume the workbook is not protected). -- Regards, Tom Ogilvy "quartz" wrote in message ... I switched to yours as follows: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function I call it as follows: Call LockWindowSize(True) That is all I have in a "Test" subroutine. And I still get the error (Application defined or object defined error) and the "ActiveWindow.EnableResize" line is highlighted. Any ideas? I get the same error when running either from the VBE or from the worksheet. "JE McGimpsey" wrote: Hmmm...it works for me. How are you calling it? Note that you can make it a bit shorter: Public Function LockWindowSize(argLock As Boolean) ActiveWindow.EnableResize = Not argLock End Function In article , quartz wrote: I have the following function which generates "Object defined" error (please correct for line wrapping): Public Function LockWindowSize(argLock As Boolean) If argLock = True Then ActiveWindow.EnableResize = False Else ActiveWindow.EnableResize = True End Function Can someone fix this for me? I am attempting to disable the currently active window from being resized. Thanks much in advance. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the workbook protected?
In article , quartz wrote: Any ideas? I get the same error when running either from the VBE or from the worksheet. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, it was maximized...I assumed that the function would work with the window
in any state; I just modified it so that it changes the state to "Normal" before attempting to lock it. BTW, is it possible to do the same thing with the application window (as opposed to the workbook)? "JE McGimpsey" wrote: Is the workbook protected? In article , quartz wrote: Any ideas? I get the same error when running either from the VBE or from the worksheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple question on With command | Excel Discussion (Misc queries) | |||
Pivot Table Error Message - "Command Text not set for command obje | Excel Discussion (Misc queries) | |||
Checking to see that a CHART exists prior to running a simple command | Excel Discussion (Misc queries) | |||
Running windows command from a VB code | Excel Programming | |||
Running Multiple Modules With 1 Command | Excel Programming |