ironj32
03-12-2007, 08:42 AM
I have the code to create a copy of a worksheet into a new workbook. For some reason I cannot figure out the code to delete the workbook...you think it would be simple, lol.
Sub CopyWorksheet()
Sheets("Saved").Copy
Set wb = ActiveWorkbook
wb.SaveAs ThisWorkbook.Path & "\" & Me.txtVendorName & ".xls"
wb.Close
End Sub
i have a button in userform (which many of you have helped me with already) that sends the new workbook as an email attachment, and i would like it to delete the new workbook too.
Thanks!
Sub CopyWorksheet()
Sheets("Saved").Copy
Set wb = ActiveWorkbook
wb.SaveAs ThisWorkbook.Path & "\" & Me.txtVendorName & ".xls"
wb.Close
End Sub
i have a button in userform (which many of you have helped me with already) that sends the new workbook as an email attachment, and i would like it to delete the new workbook too.
Thanks!