Paste from the clipboard while maintaining formatting from copied data

I am using the Excel application scope to direct commands to an open Excel window where I copy the selected data. If I were to paste that out of the paste buffer I have the formatting i.e. cell colors, gridlines, positioning but when I save it to a variable it only keeps the text content. I am actually trying to use it inside the html editor as I am building an email body that needs it to look exactly like the data I copied. I am using smtp email so I don’t think I can paste it directly into the content. Does anyone have thoughts on how to accomplish this?

The fact that copy/paste takes formatting with it within Excel, Word etc is just a special feature of Excel, Word etc. If you manually copy from Excel and paste into, say, Notepad (or this forum’s reply editor), formatting does not come with it. The formatting wouldn’t be in HTML format, anyway.

I don’t think what you’re trying to do is possible, unless there is some macro/coded way of determining the format of an Excel cell or cells and then translating that into HTML.

If I paste it into Outlook the formatting comes with it maybe thats what you are saying. The end result is I need to paste a table with colored heading cells is that possible a different way that you know of? If I just add the table it’s in a grid but with no beautification

Excel, Word, Outlook etc are all part of the same Microsoft software suite, this copy-pasting between them is a special feature since they’re all built on the same foundation. Pasting into other apps is not the same.

The end result is I need to paste a table with colored heading cells is that possible a different way that you know of?

You can manually write the HTML to format it how you want.

If you mean I can reformat the text inside the html builder I have not been able to figure that out, I am inserting the table as a variable if that matters

You’d have to use Read Range to get the data and then loop through the datatable to create a string variable with HTML in it.