send active sheet as values ​​vba

1 view
Skip to first unread message

Alex O

unread,
Jun 22, 2016, 2:24:45 AM6/22/16
to Excel VBA Lab - An Excel VBA Macro help Group
Hello, I have this code that send my file generated with a dynamic table and I want to send only as values ​​, someone knows how to accomplish this?



Sub WorksheetLoop2() Dim Current As Worksheet For Each Current In Worksheets Dim attBook$ attBook = Environ("temp") & "\" & Current.[A4] & ".xlsx" Current.Copy """ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value"" If Dir(attBook) <> "" Then Kill attBook With ActiveWorkbook .SaveAs Filename:=attBook, FileFormat:=51 .Close False End With Dim OutApp As Object Dim OutMail As Object Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = Current.[a1] .CC = Current.[a2] .BCC = "" .Subject = Current.[A3] .Body = "Buen dia, se adjunta reporte de ventas" .Attachments.Add attBook If .To = "" Then .To = "" .CC = "" .Body = "Error, "" " & Current.[A4] End If .send End With Set OutMail = Nothing Set OutApp = Nothing Next MsgBox " "" " & Date End Sub

tnks regards

Ashish Kumar

unread,
Jul 8, 2016, 11:16:49 AM7/8/16
to Excel VBA Lab - An Excel VBA Macro help Group
Hi,

Do you want to send only range ?

Elaborate more.

Regards
Ashish Kumar

Ashish Kumar

unread,
Jul 15, 2016, 11:38:24 AM7/15/16
to Excel VBA Lab - An Excel VBA Macro help Group
Hi Alex O,

waiting for your reply.


Regards
Ashish Kumar
Reply all
Reply to author
Forward
0 new messages