Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Emailing a sheet. - this should b easy - kinda urgent!

  1. #11
    Board Regular
    Join Date
    Feb 2002
    Location
    Jefferson City, Missouri
    Posts
    382
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Okay, here's the code I am currently using to send a worksheet from my workbook. I am using separate modules but you could probably use only one if you'd prefer.

    Sub SendIt()

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    'make copy of sheet to e-mail
    Sheet1.Copy
    ActiveWorkbook.SaveAs Filename:="yourfilename.xls", _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=True, CreateBackup:=False
    Application.Dialogs(xlDialogSendMail).Show _
    arg1:="email@address.com", _
    arg2:="your file name"
    'this is a separate module(module code below)
    'that closes the file that was just e-mailed
    CloseWorkbook
    'this is a separate module(code below)
    'this deletes the file after sending
    'you can omit this module if you don't mind
    'the extra workbook
    DeleteFile
    End Sub

    Code for CloseWorkbook module
    Sub CloseWorkbook()
    ActiveWorkbook.Close ("your file name")
    End Sub

    Code for deleting the file after sending

    Sub DeleteFile()
    Kill "complete path with filename where file was copied"
    End Sub

    This code works great for me. And thanks to your question I was able to complete my project.

    Viper

  2. #12
    Board Regular
    Join Date
    Mar 2002
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hi, i would like to send e-mail in excel, but don't want any attachment in that e-mail, how can i do that?

    i have done this:
    Sub Forgot_Password()

    Dim emailaddress As String
    Dim password As String
    emailaddress = ThisWorkbook.Sheets("Sheet1").Range("ea").Value
    password = ThisWorkbook.Sheets("Sheet1").Range("pw").Value
    Application.Dialogs(xlDialogSendMail).Show _
    arg1:=emailaddress, _
    arg2:=password
    End Sub

    because everytime i run this code, it attach a file that i am running. what do i need to do to stop it? i only want it to send value in a cell.
    pls let me know!

    e-mail: dreamcity88@hotmail.com

  3. #13
    Board Regular
    Join Date
    Mar 2002
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    anyone? pls help!
    thanks

  4. #14
    Board Regular
    Join Date
    Mar 2002
    Posts
    122
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    y dont you make ur own new topic and ppl mite reply . im sorry but i cant help :S only a begginner

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •