pcorpz
Active Member
- Joined
- Oct 29, 2004
- Messages
- 324
How can I disable gridline in the create temp file to send to outlook vba?
Sub Send_Email()
Dim Email_Subject, Email_Send_From, Email_Body As String, i As Integer
Dim Mail_Object, nameList As String, o As Variant, ws As Worksheet, ws1 As Worksheet
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set ws = Worksheets("SalesRep")
ans = MsgBox("Are you sure you want to send email's to all individuals in list ??", vbYesNo)
If ans = vbNo Then Exit Sub
For i = 2 To 10
Worksheets(ws.Range("A" & i).Value).Copy
With Worksheets(ws.Range("A" & i).Value).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteFormats
.Cells.PasteSpecial xlPasteValuesAndNumberFormats
End With
Application.CutCopyMode = False
TempFilePath = Environ$("temp") & ""
TempFileName = ws.Range("A" & i).Value & " " & Format(Now, "dd-mmm-yy")
FileExtStr = ".xlsx"
FileFormatNum = 51
With ActiveWorkbook
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
End With
Sub Send_Email()
Dim Email_Subject, Email_Send_From, Email_Body As String, i As Integer
Dim Mail_Object, nameList As String, o As Variant, ws As Worksheet, ws1 As Worksheet
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set ws = Worksheets("SalesRep")
ans = MsgBox("Are you sure you want to send email's to all individuals in list ??", vbYesNo)
If ans = vbNo Then Exit Sub
For i = 2 To 10
Worksheets(ws.Range("A" & i).Value).Copy
With Worksheets(ws.Range("A" & i).Value).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteFormats
.Cells.PasteSpecial xlPasteValuesAndNumberFormats
End With
Application.CutCopyMode = False
TempFilePath = Environ$("temp") & ""
TempFileName = ws.Range("A" & i).Value & " " & Format(Now, "dd-mmm-yy")
FileExtStr = ".xlsx"
FileFormatNum = 51
With ActiveWorkbook
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
End With