Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Email distribution list

Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email distribution list

Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message ...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Email distribution list

Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email distribution list

Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message ...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Email distribution list

"Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook"

What do you mean?

"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Email distribution list

Changed as suggested
MyArr = Workbooks("mysheetname.xls").Sheets("distribution" ).Range("a5:a6")
.SendMail MyArr, "Forecast"
Still giving compile error invalid or unqulified....

thanks

"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email distribution list

You copy the sheet Forecast into a new workbook with this line
Worksheets("Forecast").Copy

This is the Activeworbook now with 1 sheet
Sheets("distribution") is not in that workbook


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


"Steve" <sailor4life61@hotmaildotcom wrote in message ...
"Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook"

What do you mean?

"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message
...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks












  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Email distribution list

Now also getting an error here (Method "SaveAs of object'_Workbook' failed)

ActiveWorkbook.SaveAs "\\c:\rforecast\lfcst" & Range("B56") & ".xls"


"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email distribution list

Try this example

Sub Mail_Sheet()
Dim wb As Workbook
Dim strdate As String
Dim MyArr As Variant

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
Workbooks("mysheetname.xls").Sheets("Forecast").Co py
MyArr = Workbooks("mysheetname.xls").Sheets("distribution" ).Range("a5:a6")

Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail MyArr, "This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub


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


"Steve" <sailor4life61@hotmaildotcom wrote in message ...
Changed as suggested
MyArr = Workbooks("mysheetname.xls").Sheets("distribution" ).Range("a5:a6")
.SendMail MyArr, "Forecast"
Still giving compile error invalid or unqulified....

thanks

"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message
...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks












  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email distribution list

Hi Steve

I think you use Outlook instead of Outlook Express
Look here for a example for Outlook
http://www.rondebruin.nl/sendmail.htm#Tips

See the Outlook section


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


"Ron de Bruin" wrote in message ...
Try this example

Sub Mail_Sheet()
Dim wb As Workbook
Dim strdate As String
Dim MyArr As Variant

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
Workbooks("mysheetname.xls").Sheets("Forecast").Co py
MyArr = Workbooks("mysheetname.xls").Sheets("distribution" ).Range("a5:a6")

Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail MyArr, "This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub


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


"Steve" <sailor4life61@hotmaildotcom wrote in message ...
Changed as suggested
MyArr = Workbooks("mysheetname.xls").Sheets("distribution" ).Range("a5:a6")
.SendMail MyArr, "Forecast"
Still giving compile error invalid or unqulified....

thanks

"Ron de Bruin" wrote in message
...
Hi

Worksheets("Forecast").Copy
You copy only 1 sheet to a new workbook

MyArr = Sheets("distribution").Range("a5:a6")
It can't find the sheet in the activeworkbook because the workbook
have only a sheet named Forecast

Use this
MyArr = Workbooks("test.xls").Sheets("distribution").Range ("a5:a6")

Change the workbook name

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


"Steve" <sailor4life61@hotmaildotcom wrote in message

...
Thanks Ron I had overlooked that when browsing your site. However I am
getting a compile error. Here is my code

Sub Export()

Dim MyArr As Variant

ScreenUpdating = False
Worksheets("Forecast").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".xls"
ActiveWorkbook.SaveAs "\\c:\rforecast" & Range("B56") & ".xls"
'Dim MyArr As Variant
MyArr = Sheets("distribution").Range("a5:a6")
.SendMail MyArr, "Forecast"
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\forecast" &
Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub

"Ron de Bruin" wrote in message
...
Look here
http://www.rondebruin.nl/sendmail.htm#Tips

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


"Steve" <sailor4life61@hotmaildotcom wrote in message
...
Hello
How can I reference a distribution list Sheet1!A5:A15
using ActiveWorkbook.SendMail

Thanks














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
Email distribution of Access Record Snyderm Excel Discussion (Misc queries) 1 March 28th 09 12:28 AM
import email addresses into a outlook distribution list summer Excel Discussion (Misc queries) 3 December 11th 07 08:45 PM
How to embed email link in excel document to distribution list Natalie Excel Worksheet Functions 1 August 17th 06 03:35 PM
Email distribution of certain cells, not an entire sheet/workbook EasleyK Excel Discussion (Misc queries) 0 June 15th 06 06:23 PM
Excel Distribution list Chris Excel Discussion (Misc queries) 2 December 12th 05 05:40 PM


All times are GMT +1. The time now is 12:50 PM.

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

About Us

"It's about Microsoft Excel"