ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SendTo (https://www.excelbanter.com/excel-programming/442793-sendto.html)

Paul W Smith

SendTo
 
I have a workbook which I have written code which will not allow the user to
save the workbook unless they have provided specific pieces of information.

I had intended to not allow users to Email the worbook without the specific
information being present. My thought process was if they cannot save it
they
cannot attached it to an Email.

What users have found a way to do is to Email the unsaved workbook using
SendTo.

Can anyone suggest any way I can stop the users doing this?



Paul W Smith

SendTo
 
Just in case anyone ever comes across this post looking for the same
information to was here is a solution. This was suggested to me by Ron de
Bruin.

Use the Workbook Open event to disable the SendTo functionality.

Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=30095)
Ctrl.Enabled = False
Next Ctrl

And to return this functionality to the user in the Workbook BeforeClose
event use:

Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=30095)
Ctrl.Enabled = true
Next Ctrl

The ID of the SendTo control is 30095




"Paul W Smith" wrote in message
...
I have a workbook which I have written code which will not allow the user
to
save the workbook unless they have provided specific pieces of
information.

I had intended to not allow users to Email the worbook without the
specific
information being present. My thought process was if they cannot save it
they
cannot attached it to an Email.

What users have found a way to do is to Email the unsaved workbook using
SendTo.

Can anyone suggest any way I can stop the users doing this?






All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com