Hi All!

I have a macro runing outlook. it all works, but I want the file that is created as a variable - the one sheet of it as below , to be emailed as the attachment. So its first saved (user in puts the version number), then that file that is saved is emailed.

CODE:

Private Sub CommandButton1_Click()

variable = InputBox("Please enter a version number", "Version")

Sheets("SCHD").Select
Sheets("SCHD").Copy
ChDir "C:\Documents and Settings\eggenhuizenj\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\username\Desktop\Target Refit 2006 Schedule Ver " + variable + ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False

attach = Windows("Target Refit 2006 Schedule Ver " + variable + ".xls").Activate
ActiveWindow.Close

'Create a new Workbook Containing 1 Sheet _
and sends as attachment.
With ActiveWorkbook
attachment - created above
.SendMail Recipients:="[email protected]", _
Subject:="Find attached blah " & Format(Date, "dd/mmm/yy")
.Close SaveChanges:=False
End With
End Sub

END CODE


Any help would be greatly appreciated,


thanks!

Joel