Jan 11 2022 08:48 AM
Hi, I have produced a form in Excel, It has active x button that runs a macro to send the form to the next relevant person. The trouble im having is the data being inserted before the form is sent is being lost once it is attached to the email via the macro, the macro im using is as follows-(Email removed for security).
Sub SendToConfig()
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
'Let us create the email message aL61-2004nd display it
'Make sure to change the parameters below
With OutlookMail
.To = ""
.Subject = Range("C5") & " establishment for processing"
.HTMLBody = "Hello, please see attached product establishment for processing"
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
Please advise why i am loosing the data input on the form!
Jan 11 2022 12:33 PM
SolutionMaybe you can find some information here
Mail from Excel with SendMail (Windows)
Standard Disclaimer: These are links to non-Microsoft websites.
A wonderful site in terms of emailing (not only)
Hope I was able to help you with this info.
I know I don't know anything (Socrates)
Jan 12 2022 02:49 AM
@NikolinoDE thank you for your help, used the code here : https://www.rondebruin.nl/win/s1/outlook/amail1.htm
It now works a treat and do not loose the data, turns out it needs to save a copy of an active workbook first so this code does a temporary save and deletes it after.
Jan 12 2022 06:07 AM