I am trying to write a VBA code for sending an email of a sheet with 4 pivot tables. These pivot tables are formatted the way the client wants. I am able to copy and paste them to the Outlook email with formatting however:
1) The color of the pivot tables changes from blue to green
2) The autofit code I set in the Excel sheet is no longer being followed in the Outlook email
Here's my code for the copy and paste part:
Is there a way to just copy and paste the used range in my sheet to an Outlook Email without creating a temporary workbook? Please help thank you
1) The color of the pivot tables changes from blue to green
2) The autofit code I set in the Excel sheet is no longer being followed in the Outlook email
Here's my code for the copy and paste part:
Code:
[COLOR=#222222]Set TempWB = Workbooks.Add(1)[/COLOR][/COLOR]
With TempWB.Sheets(1)
.Cells(1).PasteSpecial Paste:=1
.Cells(1).PasteSpecial xlPasteFormats, , False, False
.Cells(1).Select
Application.CutCopyMode = False
On Error Resume Next
.DrawingObjects.Visible = True
.DrawingObjects.Delete
On Error GoTo 0
[COLOR=#242729][COLOR=#222222]End With[/COLOR]
Is there a way to just copy and paste the used range in my sheet to an Outlook Email without creating a temporary workbook? Please help thank you