Sending an email with Excel macro

R

Ralph

I am using the following code to send an email but I still have to click the
Send button. How do I automate this?

'Send by email the txt work file
Workbooks.OpenText Filename:=PCODir & PCOFil, Origin:=xlMSDOS,
StartRow:=1, _
DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1)),
TrailingMinusNumbers:=True
Application.CutCopyMode = False
Application.Dialogs(xlDialogSendMail).Show Emailto, "Pick-confirm
file attached"
ActiveWorkbook.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Open File 2
Conversion from text to excel 2
Cannot open text workbook 1
Macro error opening text file 0
Macro Error 6
How to change a Macro based on content of a cell 3
Excel Change Text to Date 2
FieldInfo 2

Top