Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Hide Print option from File Menu

I am trying to disable and hide the "Print" option from "File Menu".Also I
want to disable "CTRL + P" and Print icon from standard tool bar.

I have written the code as follow but it's not working.It's coming with an
error that" Invalid procedure call or argument."

Sub Macro1()

Sheets("Sheet1").Select
Application.CommandBars.Item("File").Controls.Item ("Print").Enabled = False
Application.CommandBars.Item("File").Controls.Item ("Print").Visible = False

End Sub


Thanks in advance.

Harish


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide Print option from File Menu

Hi Harish

See
http://www.rondebruin.nl/menuid.htm

If you need more help post back


--
Regards Ron De Bruin
http://www.rondebruin.nl



"Harish" wrote in message ...
I am trying to disable and hide the "Print" option from "File Menu".Also I
want to disable "CTRL + P" and Print icon from standard tool bar.

I have written the code as follow but it's not working.It's coming with an
error that" Invalid procedure call or argument."

Sub Macro1()

Sheets("Sheet1").Select
Application.CommandBars.Item("File").Controls.Item ("Print").Enabled = False
Application.CommandBars.Item("File").Controls.Item ("Print").Visible = False

End Sub


Thanks in advance.

Harish




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Print option from File Menu


Why not just put this in ThisWorkbook:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=554735

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Print option from File Menu


I won't mess with making thing invisible or disable, you are just
opening a can of worms, (having to set it back to visible and enable
when people exit your spreadsheet


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=554735

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Hide Print option from File Menu

As a different approach to the problem have you considered using the before
print event in this workbook. Something like this will disable the ability to
print in this workbook without affecting the entire application and other
open spreadsheets... there is also no need for strong error handling to
reseth the buttons in case the spreadsheet crashes...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox "Sorry. Printing of this spreadhseet is " & _
"not allowed", vbInformation, "Printing Cancelled"
End Sub
--
HTH...

Jim Thomlinson


"Harish" wrote:

I am trying to disable and hide the "Print" option from "File Menu".Also I
want to disable "CTRL + P" and Print icon from standard tool bar.

I have written the code as follow but it's not working.It's coming with an
error that" Invalid procedure call or argument."

Sub Macro1()

Sheets("Sheet1").Select
Application.CommandBars.Item("File").Controls.Item ("Print").Enabled = False
Application.CommandBars.Item("File").Controls.Item ("Print").Visible = False

End Sub


Thanks in advance.

Harish


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
How can I reactive the Hide option on the Format menu?? Kharas Excel Discussion (Misc queries) 1 March 10th 10 07:28 PM
read-only option not appearing on file menu marnie Excel Discussion (Misc queries) 1 October 16th 07 04:38 PM
read-only option not appearing on file menu marnie Excel Discussion (Misc queries) 2 October 16th 07 03:21 PM
Restoring the File option on the top Menu bar of Excel. Smitty50 Excel Discussion (Misc queries) 3 October 17th 06 04:45 PM
"Delete sheet" not an available option on File menu. cj6855 Excel Worksheet Functions 1 June 10th 05 09:22 PM


All times are GMT +1. The time now is 04:18 AM.

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

About Us

"It's about Microsoft Excel"