Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dj_siek
 
Posts: n/a
Default attachment - then email from excel!


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 ", _
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


--
dj_siek
------------------------------------------------------------------------
dj_siek's Profile: http://www.excelforum.com/member.php...o&userid=31247
View this thread: http://www.excelforum.com/showthread...hreadid=512492

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Name and email address from web sites to excel sheet Philip Excel Discussion (Misc queries) 0 August 10th 05 11:02 AM
Email hyperlink changes not showing in excel Nancy Excel Worksheet Functions 0 May 13th 05 12:26 AM
Excel Spreadsheet email attachment unable to open in Outlook Expr. Joanne from Tiffin, Oh Excel Discussion (Misc queries) 1 April 23rd 05 12:21 AM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
body of email disappears when I send an email from Excel ~A Excel Discussion (Misc queries) 0 February 25th 05 11:55 PM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"