• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Send The Sheet as Email Whenever saved Automatically

chadha.hitesh

New Member
Hi Friends ,


i am new to macros , i want to send the sheet as an outlook attachement automatically whenever changed Please Help
 
@Chadha


Hi


Welcome to Chandoo.org Forums, glad you are here


please follow the link


http://www.rondebruin.nl/sendmail.htm


hope it will solve your problem


Thanks


SP
 
i got a code from a website the code is

The Below mentioned code give "answer" error


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _

Cancel As Boolean)


Dim answer As String


answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" vbYesNo, "here is the title of that box")


If answer = vbNo Then Cancel = True

If answer = vbYes Then

'open outlook type stuff

Set OutlookApp = CreateObject("Outlook.Application")

Set OlObjects = OutlookApp.GetNamespace("MAPI")

Set newmsg = OutlookApp.CreateItem(olMailItem)

'add recipients

'newmsg.Recipients.Add ("Name Here")

newmsg.Recipients.Add ("sampleemailaddresshere@email.com")

'add subject

newmsg.Subject = "Subject line of auto email here"

'add body

newmsg.Body = "body of auto email here"

newmsg.Display 'display

newmsg.Send 'send message

'give conformation of sent message

MsgBox "insert confirmation box test here", , "title of confirmation box"


End If


'save the document

'Me.Worksheets.Save


End Sub


Please Help
 
@chadha


Hi


Please replace the code as


answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" &vbYesNo, "here is the title of that box")


if any problem please inform again


thanks


SP
 
Back
Top