Stelios Panayides
New Member
- Joined
- Jul 28, 2008
- Messages
- 14
I am using the following two macors to disable Print from File Menu and Toolbar:
Sub DisableMenuItems() <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
With CommandBars("File") <o></o>
.Controls(12).Enabled = False <o></o>
End With <o></o>
End Sub<o></o>
<o></o>
<o></o>
Sub DisableCommandBarControl() <o></o>
Dim cb As CommandBar<o></o>
Dim bc As CommandBarControl <o></o>
For Each cb In CommandBars<o></o>
For Each bc In cb.Controls<o></o>
If Left(bc.Caption, 5) = "Print" Then _<o></o>
bc.Enabled = False<o></o>
Next<o></o>
Next <o></o>
End Sub
The macros work fine but the problem is that the macors apply to all Excel files on my pc and that they do not work when I open the file for manother pc (after adjusted the security setting and enabling the macros)!!!
ANY HELP WOULD BE HIGHLY APPRECIATED.
THANK YOU
Sub DisableMenuItems() <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
With CommandBars("File") <o></o>
.Controls(12).Enabled = False <o></o>
End With <o></o>
End Sub<o></o>
<o></o>
<o></o>
Sub DisableCommandBarControl() <o></o>
Dim cb As CommandBar<o></o>
Dim bc As CommandBarControl <o></o>
For Each cb In CommandBars<o></o>
For Each bc In cb.Controls<o></o>
If Left(bc.Caption, 5) = "Print" Then _<o></o>
bc.Enabled = False<o></o>
Next<o></o>
Next <o></o>
End Sub
The macros work fine but the problem is that the macors apply to all Excel files on my pc and that they do not work when I open the file for manother pc (after adjusted the security setting and enabling the macros)!!!
ANY HELP WOULD BE HIGHLY APPRECIATED.
THANK YOU