Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Programmatically delete window menu commands

I have used the code at

http://support.microsoft.com/default...b;en-us;814562

" How to programmatically delete the Window Control menu commands in Excel
2002 "

which appears to work , but double clicking the menu bar still allows the
restore command to work. I am using Excel 2003 in Windows XP.

Any thoughts ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Programmatically delete window menu commands

I don't know if there is a way to disable the double-click via the API. If
your concern is that you maximized Excel and users can restore it, you might
try maxing the restore position by including code like this:

Sub MaxRestorePos()
Dim MaxW As Double
Dim MaxH As Double
With Application
.ScreenUpdating = False
.WindowState = xlMaximized
MaxW = .Width
MaxH = .Height
.WindowState = xlNormal
.Left = 0
.Top = 0
.Width = MaxW
.Height = MaxH
End With
End Sub

--
Jim
"Daveh" wrote in message
...
|I have used the code at
|
| http://support.microsoft.com/default...b;en-us;814562
|
| " How to programmatically delete the Window Control menu commands in Excel
| 2002 "
|
| which appears to work , but double clicking the menu bar still allows the
| restore command to work. I am using Excel 2003 in Windows XP.
|
| Any thoughts ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Programmatically delete window menu commands

Jim

thanks; this does what I want.

I intend to call this procedure from the Workbook_Open module, but what
would the settings be for .Width & .Height so that I can reset the
conventional restore parameters (either on Workbook_beforeclose or at another
time ) ?



"Jim Rech" wrote:

I don't know if there is a way to disable the double-click via the API. If
your concern is that you maximized Excel and users can restore it, you might
try maxing the restore position by including code like this:

Sub MaxRestorePos()
Dim MaxW As Double
Dim MaxH As Double
With Application
.ScreenUpdating = False
.WindowState = xlMaximized
MaxW = .Width
MaxH = .Height
.WindowState = xlNormal
.Left = 0
.Top = 0
.Width = MaxW
.Height = MaxH
End With
End Sub

--
Jim
"Daveh" wrote in message
...
|I have used the code at
|
| http://support.microsoft.com/default...b;en-us;814562
|
| " How to programmatically delete the Window Control menu commands in Excel
| 2002 "
|
| which appears to work , but double clicking the menu bar still allows the
| restore command to work. I am using Excel 2003 in Windows XP.
|
| Any thoughts ?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Programmatically delete window menu commands

I'm glad to here you want to restore the user to where he was. I threw this
together quickly. You'll want to test it and integrate with your API stuff.

Dim OrigLeft As Double
Dim OrigTop As Double
Dim OrigWidth As Double
Dim OrigHeight As Double
Dim OrigState As Integer

Sub MaxRestorePos()
Dim MaxW As Double
Dim MaxH As Double
With Application
.ScreenUpdating = False
OrigState = .WindowState
.WindowState = xlNormal
OrigLeft = .Left
OrigTop = .Top
OrigWidth = .Width
OrigHeight = .Height
.WindowState = xlMaximized
MaxW = .Width
MaxH = .Height
.WindowState = xlNormal
.Left = 0
.Top = 0
.Width = MaxW
.Height = MaxH
End With
End Sub

Sub ResetRestorePos()
With Application
.WindowState = xlNormal ''Just to be sure
.Left = OrigLeft
.Top = OrigTop
.Width = OrigWidth
.Height = OrigHeight
.WindowState = OrigState
End With
End Sub


--
Jim
"Daveh" wrote in message
...
| Jim
|
| thanks; this does what I want.
|
| I intend to call this procedure from the Workbook_Open module, but what
| would the settings be for .Width & .Height so that I can reset the
| conventional restore parameters (either on Workbook_beforeclose or at
another
| time ) ?
|
|
|
| "Jim Rech" wrote:
|
| I don't know if there is a way to disable the double-click via the API.
If
| your concern is that you maximized Excel and users can restore it, you
might
| try maxing the restore position by including code like this:
|
| Sub MaxRestorePos()
| Dim MaxW As Double
| Dim MaxH As Double
| With Application
| .ScreenUpdating = False
| .WindowState = xlMaximized
| MaxW = .Width
| MaxH = .Height
| .WindowState = xlNormal
| .Left = 0
| .Top = 0
| .Width = MaxW
| .Height = MaxH
| End With
| End Sub
|
| --
| Jim
| "Daveh" wrote in message
| ...
| |I have used the code at
| |
| | http://support.microsoft.com/default...b;en-us;814562
| |
| | " How to programmatically delete the Window Control menu commands in
Excel
| | 2002 "
| |
| | which appears to work , but double clicking the menu bar still allows
the
| | restore command to work. I am using Excel 2003 in Windows XP.
| |
| | Any thoughts ?
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Programmatically delete window menu commands

How about protect workbook windows but not structure

Regards,
Peter T

"Daveh" wrote in message
...
I have used the code at

http://support.microsoft.com/default...b;en-us;814562

" How to programmatically delete the Window Control menu commands in Excel
2002 "

which appears to work , but double clicking the menu bar still allows the
restore command to work. I am using Excel 2003 in Windows XP.

Any thoughts ?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Programmatically delete window menu commands

His goal is to prevent Excel itself from being restored, not the workbook.

--
Jim
"Peter T" <peter_t@discussions wrote in message
...
| How about protect workbook windows but not structure
|
| Regards,
| Peter T
|
| "Daveh" wrote in message
| ...
| I have used the code at
|
| http://support.microsoft.com/default...b;en-us;814562
|
| " How to programmatically delete the Window Control menu commands in
Excel
| 2002 "
|
| which appears to work , but double clicking the menu bar still allows
the
| restore command to work. I am using Excel 2003 in Windows XP.
|
| Any thoughts ?
|
|


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Programmatically delete window menu commands

Ah, missed that. I should have read more carefully.

Regards,
Peter T

"Jim Rech" wrote in message
...
His goal is to prevent Excel itself from being restored, not the workbook.

--
Jim
"Peter T" <peter_t@discussions wrote in message
...
| How about protect workbook windows but not structure
|
| Regards,
| Peter T
|
| "Daveh" wrote in message
| ...
| I have used the code at
|
| http://support.microsoft.com/default...b;en-us;814562
|
| " How to programmatically delete the Window Control menu commands in
Excel
| 2002 "
|
| which appears to work , but double clicking the menu bar still allows
the
| restore command to work. I am using Excel 2003 in Windows XP.
|
| Any thoughts ?
|
|




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Programmatically delete window menu commands

Jim

exactly what I wanted; thank you !

"Jim Rech" wrote:

I'm glad to here you want to restore the user to where he was. I threw this
together quickly. You'll want to test it and integrate with your API stuff.

Dim OrigLeft As Double
Dim OrigTop As Double
Dim OrigWidth As Double
Dim OrigHeight As Double
Dim OrigState As Integer

Sub MaxRestorePos()
Dim MaxW As Double
Dim MaxH As Double
With Application
.ScreenUpdating = False
OrigState = .WindowState
.WindowState = xlNormal
OrigLeft = .Left
OrigTop = .Top
OrigWidth = .Width
OrigHeight = .Height
.WindowState = xlMaximized
MaxW = .Width
MaxH = .Height
.WindowState = xlNormal
.Left = 0
.Top = 0
.Width = MaxW
.Height = MaxH
End With
End Sub

Sub ResetRestorePos()
With Application
.WindowState = xlNormal ''Just to be sure
.Left = OrigLeft
.Top = OrigTop
.Width = OrigWidth
.Height = OrigHeight
.WindowState = OrigState
End With
End Sub


--
Jim
"Daveh" wrote in message
...
| Jim
|
| thanks; this does what I want.
|
| I intend to call this procedure from the Workbook_Open module, but what
| would the settings be for .Width & .Height so that I can reset the
| conventional restore parameters (either on Workbook_beforeclose or at
another
| time ) ?
|
|
|
| "Jim Rech" wrote:
|
| I don't know if there is a way to disable the double-click via the API.
If
| your concern is that you maximized Excel and users can restore it, you
might
| try maxing the restore position by including code like this:
|
| Sub MaxRestorePos()
| Dim MaxW As Double
| Dim MaxH As Double
| With Application
| .ScreenUpdating = False
| .WindowState = xlMaximized
| MaxW = .Width
| MaxH = .Height
| .WindowState = xlNormal
| .Left = 0
| .Top = 0
| .Width = MaxW
| .Height = MaxH
| End With
| End Sub
|
| --
| Jim
| "Daveh" wrote in message
| ...
| |I have used the code at
| |
| | http://support.microsoft.com/default...b;en-us;814562
| |
| | " How to programmatically delete the Window Control menu commands in
Excel
| | 2002 "
| |
| | which appears to work , but double clicking the menu bar still allows
the
| | restore command to work. I am using Excel 2003 in Windows XP.
| |
| | Any thoughts ?
|
|
|



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Programmatically delete window menu commands

I have used the code at

http://support.microsoft.com/default...b;en-us;814562

" How to programmatically delete the Window Control menu commands in Excel
2002 "
It also works great in Excel 2003.
This doesn't seem to work for Excel 2007, however. Are there any updates. I
am using Excel 2007 in Windows XP (32).

Thanks,

Peter B
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
Immediate Window - Available Commands Patti[_2_] Excel Programming 3 April 30th 06 06:01 PM
How do I undo the Excel, Window Menu, New Window command OLDFANG Excel Discussion (Misc queries) 2 March 17th 06 05:31 PM
Issue Commands To a DOS Window Andibevan[_2_] Excel Programming 4 June 13th 05 04:23 PM
Lost my menu bar commands pod Excel Discussion (Misc queries) 3 April 29th 05 12:52 AM
menu commands are gray kcohio Excel Discussion (Misc queries) 1 December 5th 04 07:56 PM


All times are GMT +1. The time now is 08: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"