Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 在发送电子邮件之前创建工作表的临时副本_Excel_Vba - Fatal编程技术网

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 如果我的问题不清楚,请提问。以下是将

是否可以在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


如果我的问题不清楚,请提问。

以下是将单个工作表复制到新工作簿、更改副本、保存副本和关闭副本的示例。原版未更改


内容是如何修改的?你试过什么?
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