title: Is there a way to take input(email-id) from the user and automatically mail the same excel sheet using vba code?
body: <blockquote>
    <p>In Thisworksheet</p>
  </blockquote>
  
  <pre><code>Private Sub CommandButton1_Click()
  
  
       On Error GoTo ErrHandler
          ' SET Outlook APPLICATION OBJECT.
          Dim objOutlook As Object
          Set objOutlook = CreateObject("Outlook.Application")
  
  
  
      ' CREATE EMAIL OBJECT.
      Dim objEmail As Object
      Set objEmail = objOutlook.CreateItem(olMailItem)
  
          With objEmail
              .to = "webadmin@encodedna.com"
              .Subject = "This is a test message from Arun Banik"
              .Body = "Hi there"
              .Display           ' DISPLAY MESSAGE.
          End With
  
          ' CLEAR.
          Set objEmail = Nothing:    Set objOutlook = Nothing
  
  ErrorHandler:
          '
      End Sub
  </code></pre>
  
  <blockquote>
    <p>In Module,
    So is there way where i can take input from the user and the excel sheet gets sent to respective email id</p>
  </blockquote>
  
  <pre><code>With objEmail
  
  
      .To = "arunbanik21@rediffmail.com"
          .CC = "arun@mail.com"
          .BCC = "arun@hotmail.com"
          .Subject = "This is a test message from Arun"
          .Body = "Hi there"
          .Attachments.Add ("e:\report.doc")
          .Send
  
  
    End With
  </code></pre>