Thread: Email Worksheet
View Single Post
  #1 (permalink)  
Old November 3rd, 2005, 01:38 PM
alannoble26 alannoble26 is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email Worksheet

Hello,

I have a problem. I have a large workbook which has a number of worksheets, for which when I open the workbook the worksheets automatically gets hidden. Then the user form opens and allows the user to choose functions. I then want the user to be able to click send to IT and it opens one worksheet and sends that one worksheet alone without all the others and all the VBA code in it, is that possible. So when IT opens the emails and the spreadsheets, it is a somple one page document that they don't havr to enable macros

This is the code I have already

Private Sub cmd_enter_Click()

Dim confirm As Integer
Dim objOL As New Outlook.Application
Dim objMail As MailItem

Dim Details As Worksheet
Dim calendar As Worksheet
Dim Password As Worksheet
Dim timesheet As Worksheet
Dim main As Worksheet

Set Details = ActiveWorkbook.Worksheets("Details")
Set Password = ActiveWorkbook.Worksheets("Password")
Set calendar = ActiveWorkbook.Worksheets("calendar")
Set timesheet = ActiveWorkbook.Worksheets("timesheet")
Set main = ActiveWorkbook.Worksheets("main")

            Details.Visible = True
            Password.Visible = False
            calendar.Visible = False
            timesheet.Visible = False
            main.Visible = False

    Set objOL = New Outlook.Application
    Set objMail = objOL.CreateItem(olMailItem)

    confirm = MsgBox("Are you sure you want to do this?", vbQuestion + vbYesNo, "Alexander Mann Solutions New Starter Tool")

    If confirm = vbYes Then

    ActiveWorkbook.SendMail "EMAIL ADDRESS", "Update - New User", Null


    End If

If someone can help, it would be great
Reply With Quote