Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA version problem

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VBA version problem

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" wrote in message ...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA version problem

Hi Ron,

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

"Ron de Bruin" wrote:

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" wrote in message ...
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.




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
Excel Version Problem RemyMaza Excel Discussion (Misc queries) 2 March 27th 08 04:28 PM
Version Problem Mian_Ghous Excel Worksheet Functions 2 November 19th 07 12:31 PM
Version Problem Mian_Ghous Excel Worksheet Functions 0 November 19th 07 05:24 AM
Excell version problem??? Mabe-GE Excel Worksheet Functions 4 January 24th 06 11:19 PM
version problem Lisa Excel Discussion (Misc queries) 4 April 1st 05 06:57 PM


All times are GMT +1. The time now is 10:47 PM.

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"