Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 104
Default Security on an attachment

Is there anyway to prevent an excel worksheet from being attahced to an email?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Security on an attachment

Maybe. See File, Permission, Do not distribute.

Cathy wrote:

Is there anyway to prevent an excel worksheet from being attahced to an email?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Security on an attachment

Cathy,
I think 'Bob I' has offered what many would consider the best solution since
it involves 'normal' features of Windows and Excel.

There is also a VBA code solution that I can offer. The code disables the
"Send To" entry under the File menu, and disables the e-Mail icon in the
standard toolbar when you have the workbook open and chosen. If you close
the workbook, or switch to another while the sensitive one is open, those
options are re-enabled so they can be used again/with the other workbook(s).
There are 2 steps to getting this code into your workbook.

STEP 1: The following code goes into a standard code module. To put it
there, open your sensitive workbook and press [Alt]+[F11] to open the VB
Editor. Choose 'Insert' and 'Module' from the VBE menu bar. Copy the
following code and paste it into the module presented to you:

Private Sub DisableSendTo()
Const eMailButtonID = 3738
Dim anyButton As Object

For Each anyButton In CommandBars("Standard").Controls
If anyButton.ID = eMailButtonID Then
anyButton.Enabled = False
End If
Next
CommandBars("Worksheet Menu Bar"). _
Controls("File").Controls("Send To").Enabled = False
End Sub

Private Sub EnableSendTo()
Const eMailButtonID = 3738
Dim anyButton As Object

For Each anyButton In CommandBars("Standard").Controls
If anyButton.ID = eMailButtonID Then
anyButton.Enabled = True
End If
Next
CommandBars("Worksheet Menu Bar"). _
Controls("File").Controls("Send To").Enabled = True
End Sub

close the VB Editor.

STEP 2: This code goes into the same workbook's Workbook code segment. To
get to that, right-click on the Excel icon that's to the immediate left of
the word "File" in the Excel menu bar and choose [View Code] from the pop-up
list that appears. Copy and paste the code below into that module and again
close the VB Editor.

Private Sub Workbook_Open()
Run "DisableSendTo"
End Sub

Private Sub Workbook_Activate()
Run "DisableSendTo"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Run "EnableSendTo"
End Sub

Private Sub Workbook_Deactivate()
Run "EnableSendTo"
End Sub


If it doesn't seem to disable the eMail icon in the Standard tool bar, it
may be that the ID for the email Icon is different than the 3738 that it is
in my Excel 2003 copy. If you need to find the number for your version, the
code below can be copied into a regular module and run to tell you what the
ID numbers for the icons in your version's toolbar a
Sub FindIDs()
Dim anyButton As Object

For Each anyButton In CommandBars("Standard").Controls
ActiveCell = anyButton.ID
ActiveCell.Offset(0, 1) = anyButton.TooltipText
ActiveCell.Offset(1, 0).Activate
Next

End Sub





"Cathy" wrote:

Is there anyway to prevent an excel worksheet from being attahced to an email?

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
email as attachment swimbugs Excel Discussion (Misc queries) 1 March 28th 07 02:14 AM
Help to Send as attachment. Pools New Users to Excel 7 July 2nd 06 03:03 AM
Send as Attachment [email protected] Excel Discussion (Misc queries) 0 June 7th 06 06:50 PM
Attachment Format SueG3001 Excel Discussion (Misc queries) 3 May 23rd 06 09:15 PM
add a attachment button pietje Excel Discussion (Misc queries) 0 November 11th 05 07:01 PM


All times are GMT +1. The time now is 08:01 AM.

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"