VBA version problem

G

Guest

Hi,

I am trying to use the below code to send a range of cells as an e-mail. Works great at home (WinXp & Office 2003), but fails in the work environment where I need it (WinNT4, Outlook 2000 SR1 & Excel97 SR2). Could anyone please point me in the right direction?

Private Sub CommandButton1_Click()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("C2:Q44").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "These are the latest figures as of: - " & Now()
.Item.To = ActiveSheet.Range("C46")
.Item.CC = ActiveSheet.Range("C47")
.Item.Subject = "ASA Update @" & Now()
.Item.Send
End With
End Sub

Many thanks, as always.

Mike.
 
R

Ron de Bruin

Hi UKNewbie

Not possible with excel 97-2000 with the MailEnvelope

Look on my site for examples that will work for 2000 also.

But for 97 you can only use this example
http://www.rondebruin.nl/mail/oebody.htm
will also work with Outlook

--
Regards Ron de Bruin
http://www.rondebruin.nl


UKNewbie said:
Hi,

I am trying to use the below code to send a range of cells as an e-mail. Works great at home (WinXp & Office 2003), but fails in
the work environment where I need it (WinNT4, Outlook 2000 SR1 & Excel97 SR2). Could anyone please point me in the right direction?
 
G

Guest

Hi Ron,

Just visited your site - superb stuff. Found exactly what I was looking for
so thank you very much.
 

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

Top