Excel 在发送电子邮件之前创建工作表的临时副本
是否可以在excel中执行以下操作:Excel 在发送电子邮件之前创建工作表的临时副本,excel,vba,Excel,Vba,是否可以在excel中执行以下操作: 1. User clicks 'SEND SHEET' 2. Script is ran on a temporary sheet, modifying it's content 3. Temporary sheet is attached to the email 4. The original sheet does not change 电子邮件部分不是问题,但是我不知道如何在一个自包含的excel文件中执行步骤2 如果我的问题不清楚,请提问。以下是将
1. User clicks 'SEND SHEET'
2. Script is ran on a temporary sheet, modifying it's content
3. Temporary sheet is attached to the email
4. The original sheet does not change
电子邮件部分不是问题,但是我不知道如何在一个自包含的excel文件中执行步骤2
如果我的问题不清楚,请提问。以下是将单个工作表复制到新工作簿、更改副本、保存副本和关闭副本的示例。原版未更改
内容是如何修改的?你试过什么?
Sub MakeACopy()
ActiveSheet.Copy
'
' We are now in a new workbook
'
Sheets("Sheet1").Range("A1").Value = "stuff"
ActiveWorkbook.SaveAs Filename:="Temporary.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.Close
'
' We are now back in the original workbook
'
ActiveWorkbook.Close
End Sub