Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default turning off minimize, maximize & close

I want to add a level of security to my file to force the file to auto close by macro only. I've added code to turn of the menus. Is there code I can include to turn off the three icons in the upper left corner; minimize, restor/maximize & close?

Thanks.

Kevin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default turning off minimize, maximize & close

Hi

Not sure about the minimise/maximise but you can disable
the close button by using a CloseSwitch variable

Public CloseSwitch

Sub Workbook_Open()
CloseSwitch = True 'set the switch to true
end sub

Sub Workbook Before_Close()
Select Case CloseSwitch
Case True
Cancel = True 'Workbook can't be closed
Case False
Cancel = False 'Workbook can be closed
End Select

Having set the CloseSwitch to True on opening the
workbook, the workbook can't be closed. Set the
CloseSwitch to False in your AutoClose macro and the
workbook will close.





-----Original Message-----
I want to add a level of security to my file to force the

file to auto close by macro only. I've added code to turn
of the menus. Is there code I can include to turn off the
three icons in the upper left corner; minimize,
restor/maximize & close?

Thanks.

Kevin
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default turning off minimize, maximize & close

Make that the three icons in the upper right corner.

----- Kevin wrote: -----

I want to add a level of security to my file to force the file to auto close by macro only. I've added code to turn of the menus. Is there code I can include to turn off the three icons in the upper left corner; minimize, restor/maximize & close?

Thanks.

Kevin
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default turning off minimize, maximize & close

Kevin

under the project explorer double click on workbook
put the Public CloseSwitch under the declarations
set the CloseSwitch to true under the workbook_open event
and the select case in the workbook before_close event

None of it is in a module.

being public the CloseSwitch can be changed in other
procedures such as your macro

-----Original Message-----
Libby, thanks for the response. However, I can't get

this to work.

With the following code in Module1,

Public CloseSwitch
Sub Workbook_Open()
CloseSwitch = True
End Sub

And no other code in the workbook, I am able to close the

workbook.

Have I applied the code correctly?

Also is the following a complete subroutine? Do I place

it in a module?

Sub Workbook Before_Close()
Select Case CloseSwitch
Case True
Cancel = True 'Workbook can't be closed
Case False
Cancel = False 'Workbook can be closed
End Select

Thanks again.

Kevin
----- Libby wrote: -----

Hi

Not sure about the minimise/maximise but you can

disable
the close button by using a CloseSwitch variable

Public CloseSwitch

Sub Workbook_Open()
CloseSwitch = True 'set the switch to true
end sub

Sub Workbook Before_Close()
Select Case CloseSwitch
Case True
Cancel = True 'Workbook can't be closed
Case False
Cancel = False 'Workbook can be closed
End Select

Having set the CloseSwitch to True on opening the
workbook, the workbook can't be closed. Set the
CloseSwitch to False in your AutoClose macro and the
workbook will close.





-----Original Message-----
I want to add a level of security to my file to

force the
file to auto close by macro only. I've added code

to turn
of the menus. Is there code I can include to turn

off the
three icons in the upper left corner; minimize,
restor/maximize & close?
Thanks.
Kevin

.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default turning off minimize, maximize & close

Thanks again Libby

I located the code as you instructed

Public CloseSwitc
Sub Workbook_Open(
CloseSwitch = Tru
End Su
Sub Workbook_Before_Close(
Select Case CloseSwitc
Case Tru
Cancel = True 'Workbook can't be close
Case Fals
Cancel = False 'Workbook can be close
End Selec

Note Workbook_Before_Close rather than Workbook Before_Close. Do I have it correct

However, the close switch continues to close the workbook

What should I do

Thanks

Kevi
----- Libby wrote: ----

Kevi

under the project explorer double click on workboo
put the Public CloseSwitch under the declaration
set the CloseSwitch to true under the workbook_open even
and the select case in the workbook before_close even

None of it is in a module

being public the CloseSwitch can be changed in other
procedures such as your macr

-----Original Message----
Libby, thanks for the response. However, I can't get

this to work
With the following code in Module1
Public CloseSwitc

Sub Workbook_Open(
CloseSwitch = Tru
End Su
And no other code in the workbook, I am able to close the

workbook
Have I applied the code correctly
Also is the following a complete subroutine? Do I place

it in a module
Sub Workbook Before_Close(

Select Case CloseSwitc
Case Tru
Cancel = True 'Workbook can't be close
Case Fals
Cancel = False 'Workbook can be close
End Selec
Thanks again
Kevi

----- Libby wrote: ----
H
Not sure about the minimise/maximise but you can

disable
the close button by using a CloseSwitch variabl
Public CloseSwitc
Sub Workbook_Open(

CloseSwitch = True 'set the switch to tru
end su
Sub Workbook Before_Close(

Select Case CloseSwitc
Case Tru
Cancel = True 'Workbook can't be close
Case False
Cancel = False 'Workbook can be close
End Selec
Having set the CloseSwitch to True on opening the

workbook, the workbook can't be closed. Set the
CloseSwitch to False in your AutoClose macro and the
workbook will close
-----Original Message----

I want to add a level of security to my file to

force the
file to auto close by macro only. I've added code

to turn
of the menus. Is there code I can include to turn

off the
three icons in the upper left corner; minimize,
restor/maximize & close
Thanks
Kevi




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
Moved workbook-File name, minimize, maximize and close are not vis KELC-F/A Excel Worksheet Functions 2 July 1st 09 12:46 AM
Shortcut key minimize/maximize druus Excel Discussion (Misc queries) 1 January 11th 08 06:51 PM
Title bar is missing maximize, minimize, close Zoya Excel Discussion (Misc queries) 3 August 14th 07 06:34 AM
Title Bar minimize, maximize & close icons not present Charlie Shaw Excel Discussion (Misc queries) 8 May 20th 07 02:19 AM
how do i minimize/maximize a workbook from vba? I want to minimize it durring processing to speed things up a bit Daniel Excel Worksheet Functions 2 July 9th 05 03:35 AM


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