Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zoo Zoo is offline
external usenet poster
 
Posts: 40
Default How can I make File-Save , File-SaveAs Menu disabled?

Hi,
Can I make File-Save and File-SaveAs Menu of Excel.exe disabled
by using any WIN32API or other ways?
Making them invisible is the best for me, but making them gray is also good
for me.
Thanks in advance.

(Win2000+Excel2002)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How can I make File-Save , File-SaveAs Menu disabled?

With Application.CommandBars("Worksheet Menu Bar").Controls("File")
.Controls("Save").Visible = False
.Controls("Save As Menu").Visible = False
End With

Don't forget to put them back.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zoo" wrote in message
...
Hi,
Can I make File-Save and File-SaveAs Menu of Excel.exe disabled
by using any WIN32API or other ways?
Making them invisible is the best for me, but making them gray is also

good
for me.
Thanks in advance.

(Win2000+Excel2002)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How can I make File-Save , File-SaveAs Menu disabled?

.Controls("Save As Menu").Visible = False

should be

.Controls("Save As...").Visible = False

While these will disable the menu items, the user can still do a
Save with CTRL+S

To actually disable saving, put the following code in the
ThisWorkbook code module:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel
As Boolean)
ThisWorkbook.Saved = True
Cancel = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Bob Phillips" wrote in message
...
With Application.CommandBars("Worksheet Menu
Bar").Controls("File")
.Controls("Save").Visible = False
.Controls("Save As Menu").Visible = False
End With

Don't forget to put them back.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing
direct)

"Zoo" wrote in message
...
Hi,
Can I make File-Save and File-SaveAs Menu of Excel.exe
disabled
by using any WIN32API or other ways?
Making them invisible is the best for me, but making them gray
is also

good
for me.
Thanks in advance.

(Win2000+Excel2002)





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How can I make File-Save , File-SaveAs Menu disabled?

I didn't know what Save As Menu was, so assumed it was something 2003 (which
I don't use) <g

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chip Pearson" wrote in message
...
.Controls("Save As Menu").Visible = False


should be

.Controls("Save As...").Visible = False

While these will disable the menu items, the user can still do a
Save with CTRL+S

To actually disable saving, put the following code in the
ThisWorkbook code module:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel
As Boolean)
ThisWorkbook.Saved = True
Cancel = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Bob Phillips" wrote in message
...
With Application.CommandBars("Worksheet Menu
Bar").Controls("File")
.Controls("Save").Visible = False
.Controls("Save As Menu").Visible = False
End With

Don't forget to put them back.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing
direct)

"Zoo" wrote in message
...
Hi,
Can I make File-Save and File-SaveAs Menu of Excel.exe
disabled
by using any WIN32API or other ways?
Making them invisible is the best for me, but making them gray
is also

good
for me.
Thanks in advance.

(Win2000+Excel2002)







  #5   Report Post  
Posted to microsoft.public.excel.programming
Zoo Zoo is offline
external usenet poster
 
Posts: 40
Default How can I make File-Save , File-SaveAs Menu disabled?

Thank you , Bob.
I'm happy to know that he solution is so much easier than I thought.
That helps me so much.


"Bob Phillips" wrote in message
...
With Application.CommandBars("Worksheet Menu Bar").Controls("File")
.Controls("Save").Visible = False
.Controls("Save As Menu").Visible = False
End With

Don't forget to put them back.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zoo" wrote in message
...
Hi,
Can I make File-Save and File-SaveAs Menu of Excel.exe disabled
by using any WIN32API or other ways?
Making them invisible is the best for me, but making them gray is also

good
for me.
Thanks in advance.

(Win2000+Excel2002)




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
in a excel file, how to make a menu item for the .xls file that when clicked on it runs myform.show? example plz Daniel Excel Worksheet Functions 1 July 7th 05 03:52 AM
Save and Saveas Greyed out on tool bar and file menu Shareena Howley Setting up and Configuration of Excel 1 July 5th 05 01:02 PM
XML Source Menu Item disabled?? File version?? Jay Lauffer Excel Discussion (Misc queries) 1 December 3rd 04 10:23 PM
using SaveAs to save 'only' one sheet from one book to a new file Randy W Excel Programming 2 January 12th 04 08:21 PM
overwrite Excel SaveAs function from File menu susie Excel Programming 1 July 31st 03 04:47 AM


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