Hi, I've been working on this code for quite some time now.
I have seen it work most of the time but its very glitchy and produces a runtime error then closes all my excel windows.
What I wanted to accomplish is to copy multiple sheets into a new workbook then save the file or send an email.
The error starts at the line where i've declared the sheets (array) to be copied.
Private Sub Export_Client()
'exports the relevant sheets for the report
Dim wb As Workbook
Dim NewWb As Workbook
'Create Excel sheet link
Set wb = ActiveWorkbook
Sheets(Array("Ratings Summary Voice", "Ratings Summary Email", "Device Tally", "Agent Summary Email", "Agent Summary Voice")).Copy
Set NewWb = ActiveWorkbook
'Change the Link to your desired location.
NewWb.SaveAs "C:\Documents and Settings\Book1.xlsx"
Application.Run ("Email_Client")
NewWb.Close
End Sub
Bookmarks