I\'m trying to let my users send email easily from their Excel spreadsheets, which they like to use as front-ends for data entry and manipulation. My intention is to write a
To run the function only on a click you can try entering as a subaddress:
=HYPERLINK("#generateEmail(H2, I2, M2)", "Generate Email")
and then add an extra line in the code to return the current address:
Function generateEmail(name, manager, cc)
Set generateEmail = Selection
'Paste Outlook Code Here
End Function
Note this method does not get executed on the main vba thread so to test you can insert statements in the code instead of stepping through, eg:
Range("A10:C10") = Array(name, manager, cc)