close

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(quot;Please enter a version numberquot;, quot;Versionquot;)

Sheets(quot;SCHDquot;).Select
Sheets(quot;SCHDquot;).Copy
ChDir quot;C:\Documents and Settings\eggenhuizenj\Desktopquot;
ActiveWorkbook.SaveAs Filename:= _
quot;C:\Documents and Settings\username\Desktop\Target Refit 2006
Schedule Ver quot; variable quot;.xlsquot;, FileFormat:= _
xlNormal, Password:=quot;quot;, WriteResPassword:=quot;quot;,
ReadOnlyRecommended:=False _
, CreateBackup:=False

attach = Windows(quot;Target Refit 2006 Schedule Ver quot; variable
quot;.xlsquot;).Activate
ActiveWindow.Close

'Create a new Workbook Containing 1 Sheet _
and sends as attachment.
With ActiveWorkbook
attachment - created above
.SendMail quot;, _
Subject:=quot;Find attached blah quot; amp; Format(Date, quot;dd/mmm/yyquot;)
.Close SaveChanges:=False
End With
End Sub

END CODEAny help would be greatly appreciated,thanks!

Joel--
dj_siek
------------------------------------------------------------------------
dj_siek's Profile: www.excelforum.com/member.php...oamp;userid=31247
View this thread: www.excelforum.com/showthread...hreadid=512492

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()