Ask Experts Questions for FREE Help !
Ask
    J15491's Avatar
    J15491 Posts: 1, Reputation: 1
    New Member
     
    #1

    Dec 7, 2010, 09:48 AM
    I want to send a worksheet to a specific recipient using a userform w/ radio buttons
    I have a workbook with multiple pages. I have code to send my target worksheets and a userform3 that allows me to select the recipient of the worksheet and it works fine. I need to have the userform3 work with the following worksheet as well. Right now I click on the EMAIL D.A.O. Worksheet and I get the following message box: Outlook express A program is attempting to send the following e-mail message on your behalf: Subject DAO Worksheet Would you like to send the message? I want to have a user form allowing me to select the area manager I want to send it to. All my other worksheets work fine, it is just this one. Can someone help me. I'm not really good with this stuff. Userform3 allows me to click on a radio button to select the appropriate recipient


    Private Sub CommandButton4_Click()
    'copy & Send DAO Worksheet
    Dim wSheet As Worksheet
    Dim FileExtStr As String
    Dim Sourcewb As Workbook
    Dim Destwb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String
    '
    Set Sourcewb = ActiveWorkbook
    Sourcewb.worksheets("DAO Worksheet").Activate
    '
    ActiveSheet.Copy
    '
    Set wSheet = ActiveWorkbook.worksheets("DAO Worksheet")
    wSheet.Activate
    With wSheet
    .Cells.Copy
    .Cells.PasteSpecial xlPasteValues
    .Cells(1).Select
    Application.CutCopyMode = False
    End With
    '
    TempFilePath = Environ$("temp") & "\"
    TempFileName = "DAO COPY"
    FileExtStr = ".xls"
    '
    Application.DisplayAlerts = False
    With ActiveWorkbook
    .SaveAs TempFilePath & TempFileName & FileExtStr
    End With
    Application.DisplayAlerts = True
    '
    SendDAO
    '
    With ActiveWorkbook
    .Close SaveChanges:=False
    End With
    Kill TempFilePath & TempFileName & FileExtStr
    With Application
    .ScreenUpdating = True
    .EnableEvents = True
    End With
    '
    Sheet7.Activate
    '
    End Sub
    Private Sub SendDAO()
    On Error Go to NOSEND
    ActiveWorkbook.SendMail _
    Recipients:="[email protected]", _
    Subject:="DAO WkSheet"
    '
    Exit Sub
    '
    NOSEND:
    MsgBox ("NOT SENT SUCCESSFULLY - PLEASE SEND MANUALLY AS AN ATTACHMENT")
    End Sub
    Private Sub EMAILDM_Click()
    UserForm3.Show
    End Sub

Check out some similar questions!

What would cause my radio to squeal and then cut out? Light s and buttons work fine [ 3 Answers ]

My 2003 Honda Accord radio makes a loud squealing noise and then goes out. The lights and buttons work fine.

Fill Userform From Database [ 1 Answers ]

Hi, This is the Ultimate Question!! I already finished my program in VBA, it has a userform for filling data into Word. It has a bunch of textboxes. But people has to fill de information into the textboxes every time they open the userform. Information that is already in a databse...

Buttons on radio in Dodge minivan doesn't always work [ 0 Answers ]

I own a 2001 dodge minivan. When I'm driving along my radio/cdplayer buttons will no longer work. I can't adjust the volume, turn it off etc. When I start the car later it works fine for a few minutes then it no longer works. What is wrong?

Cannot send email to specific address n Outlook 2003 [ 4 Answers ]

I have a workstation running Windows XP Sp2, Outlook 2003, Firefox. Outlook has two accounts created. Both can receive - and send to any address except one. No filters have been set up. I deleted the contact and re-entered it. I can send to any other address - just not that one. What gives?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.