I am not well versed in vba but have understood enough to create a user feedback form.
What I am trying to do is email a single worksheet (which is the the first sheet because that is used to collect the data, the second sheet which is what I want to attach is where the data is stored.
I have been doing research online and the only two solutions I can find is either email the active sheet or email the entire workbook. I feel the code I have is close to what I want to accomplish but I want it to send sheet 2 as the attachment and not sheet 1.
Dim SourceWB As Workbook
Dim DestinWB As Workbook
Dim OutlookApp As Object
Dim OutlookMessage As Object
Dim TempFileName As Variant
Dim ExternalLinks As Variant
Dim TempFilePath As String
Dim FileExtStr As String
Dim DefaultName As String
Dim UserAnswer As Long
'Dim x As LongDim
Dim strDate As String
'Optimize Code
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
'Copy only selected sheets into new workbook
ActiveWorkbook.Sheets("Sheet2").Copy //there is where is bugs out
strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strDate & ".xls"
Set SourceWB = ActiveWorkbook
SourceWB.Windows(1).SelectedSheets.Copy
Set DestinWB = ActiveWorkbook
Any assistance is greatly appreciated.
also posted on ozgrid: http://www.ozgrid.com/forum/showthre...844#post791844
Bookmarks