excel - 需要密码才能在 excel 365 中共享/发送电子邮件
问题描述
我有一个宏,在用户保存之前需要密码。我希望在用户可以使用共享按钮发送电子邮件之前需要一个。
这是我保存密码宏的代码
Private Sub Workbook_Beforesend(ByVal SendmailUI As Boolean, Cancel As Boolean)
'This macro disables the "Save As" Feature in Excel
'This means that a user will not be able to save this
'workbook(file) under a different name or in a different location
'
'This MUST be placed in "ThisWorkbook" and NOT in a Module.
'
Const strPassword = "PASSWORD" ' the password to unlock Save As
If InputBox("Enter the password to display the Save As dialog, or click Cancel") <> strPassword Then
MsgBox "You can't save this workbook!" & vbNewLine _
& "To save this work book use the 'Click to Submit' button" & vbNewLine _
& "this will save for you!"
Cancel = True
End If
End Sub
解决方案
推荐阅读
- vba - VBA:在用户窗体中一次移动多个元素
- ssl - Kentico SMTP:使用 TLS 而不是 SSL
- php - 仅在 Woocommerce 中删除虚拟产品的订单备注结帐字段
- c++ - 如何处理这些旧式演员表?
- teamcity - 在不同时间使用不同的自定义参数安排 teamcity 构建
- aws-api-gateway - YAML 异常 - 无法读取隐式映射对
- authentication - 如何制作公司自己的登录按钮
- python - 用于替换字符串中的字符的 Lambda 函数
- javascript - 为加载的图像设置类的宽度和高度属性
- python - 'L' 代表 PostgreSQL 中的计数查询