![outlook conditional formatting disappears outlook conditional formatting disappears](https://www.repairwin.com/wp-content/uploads/2020/04/image-2.png)
Set oapp = CreateObject("Outlook.Application") Mval = Format(.Cells(.Columns(1).Find(What:="Shalom", LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlB圜olumns, SearchDirection:=xlNext, MatchCase:=False).Row + 3, 6).Value, "$#,#") If ActiveSheet.name "NAME" Then Exit Subĭim lrtable As Long, lrlegend As Long, lc As Long Private msg As Outlook.MailItem, oapp As Outlook.Application Private i As Long, legendrng As Range, tablerng As Range, mval As String, sdate As String, bmonth As String, bdate As String Private Sub send_keys_test() ' how i've been attempting to do sendkeys
#Outlook conditional formatting disappears code
Private Function CopyRangeToHTML(ByVal name As Range) 'RDB's code Private Sub SetToNothing() 'set blah = nothing Private Sub MsgContent() ' Creates the email and uses the sheet vals Private Sub SheetVals() 'sets the ranges in the excel sheet and values variables Public Sub execute() 'the one that calls the private subs in the preferred order There are five (5) subroutines and one (1) function in the below code, in this order: Note: I had to bastardize module names and remove some content (standard), so pardon the not so specific labels on the private subs being called. Given I am attempting SendKeys, does anyone know why I cannot get the paste to work?
![outlook conditional formatting disappears outlook conditional formatting disappears](https://i2.wp.com/quadexcel.com/wp/wp-content/uploads/2014/07/FlexGrid_ConditionalFormatting-1-1.png)
#Outlook conditional formatting disappears how to
If anyone is aware how to modify RDB's code to allow conditionally formatted cells, that would also be awesome. so I'll try to keep this specific to the code I have created/modified. Making an image (png) of the range is not an acceptable output as there are links that need to be followed in one column of the range to be pasted.Īdditional suggestions would be appreciated, though that would make this a subjective, discussion piece which is Too Broad for StackOverflow. When copying a range from Excel, which has basic coloring as well as additional coloring from conditional formatting, I am unable to paste the desired range into an Outlook email via code as the conditional formatting colors are removed. I have attempted to step through and manually Ctrl+V and there is no pastable content, despite the spreadsheet having the selected range outlined. I have attempted to move onto using SendKeys, where I cannot get "^V" to work, hoping that there is another way to do this. Cells(1).PasteSpecial xlPasteAllUsingSourceTheme (suggested here), though that also does not appear to resolve the issue. I have attempted a suggested workaround altering the existing code to include. In trying to get the contents of my email appropriate, I have found that the RangetoHTM function RDB created does not maintain colors applied via conditional formatting. I have dug around and learned to create an email per Rob de Bruin's guide, herein "RDB".