Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

I have been asked to look at a form in Excel which is automatically sent to
an email address depending on the data it contains. I have used a listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Programatically sending a sheet through Outlook

Everything you wanted to know but were afraid to ask... This is an excellent
reference for e-mailing...

http://www.rondebruin.nl/

HTH

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically sent to
an email address depending on the data it contains. I have used a listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

Thanks

I have installed sendmail and copied the macro but I keep getting 1004
errors....

Sub Mail_Workbook_2()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim wbname As String
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
wbname = "C=:/" & wb1.Name & " " & _
Format(Now, "dd-mm-yy h-mm-ss") & ".xls"
wb1.SaveCopyAs wbname
Set wb2 = Workbooks.Open(wbname)
With wb2
..SendMail Sheets("mysheet").Range("j1").Value, _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub



"Jim Thomlinson" wrote in message
...
Everything you wanted to know but were afraid to ask... This is an
excellent
reference for e-mailing...

http://www.rondebruin.nl/

HTH

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically sent
to
an email address depending on the data it contains. I have used a
listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Programatically sending a sheet through Outlook

What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically sent to
an email address depending on the data it contains. I have used a listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

wb1.SaveCopyAs wbname

"Jim Thomlinson" wrote in message
...
What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically sent
to
an email address depending on the data it contains. I have used a
listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Programatically sending a sheet through Outlook

Your path is not correct. You have C: forward slash not c: Back slach
change

C:/

to

C:\

HTH
"Jim Thomlinson" wrote:

What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically sent to
an email address depending on the data it contains. I have used a listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address in
the worksheet - save a worksheet to a secified location then sent it via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

Thanks Jim, it still doesnt want to play though :(

"Jim Thomlinson" wrote in message
...
Your path is not correct. You have C: forward slash not c: Back slach
change

C:/

to

C:\

HTH
"Jim Thomlinson" wrote:

What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically
sent to
an email address depending on the data it contains. I have used a
listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address
in
the worksheet - save a worksheet to a secified location then sent it
via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Programatically sending a sheet through Outlook

Do you have Root Access to the C drive. Translation... Try saving something
into the root of your C drive. Very often administrators lock that down for
you to keep you form messing with systme files and the like...

HTH

"Mark Scott" wrote:

Thanks Jim, it still doesnt want to play though :(

"Jim Thomlinson" wrote in message
...
Your path is not correct. You have C: forward slash not c: Back slach
change

C:/

to

C:\

HTH
"Jim Thomlinson" wrote:

What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically
sent to
an email address depending on the data it contains. I have used a
listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in Outlook
(Exchange 2003). I would like the macro ro reference an email address
in
the worksheet - save a worksheet to a secified location then sent it
via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

I am the administrator :)

Would it help if I posted the XLS file on here?

Regards

Mark

"Jim Thomlinson" wrote in message
...
Do you have Root Access to the C drive. Translation... Try saving
something
into the root of your C drive. Very often administrators lock that down
for
you to keep you form messing with systme files and the like...

HTH

"Mark Scott" wrote:

Thanks Jim, it still doesnt want to play though :(

"Jim Thomlinson" wrote in
message
...
Your path is not correct. You have C: forward slash not c: Back slach
change

C:/

to

C:\

HTH
"Jim Thomlinson" wrote:

What line do you get the 1004 error on?

"Mark Scott" wrote:

I have been asked to look at a form in Excel which is automatically
sent to
an email address depending on the data it contains. I have used a
listbox
and a combination of IF and CONCATENATE to make the email address.

What I need to do now is to send this sheet as an attachment in
Outlook
(Exchange 2003). I would like the macro ro reference an email
address
in
the worksheet - save a worksheet to a secified location then sent it
via
Outlook as an attachment to the address referenced.

Any clues or ideas?

Regards

Mark








  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Programatically sending a sheet through Outlook

Try changing the wbname = "C=:/" & etc....

to

wbname = "C:\" & etc

ie No = (equals sign) and us the backslash.

Cheers

Tony


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programatically sending a sheet through Outlook

Thanks, that sorted the saving the sheet but I now get a subscript out of
range at:

Set wb2 = Workbooks.Open(wbname)
With wb2
..SendMail Sheets("mysheet").Range("j1").Value, _
"This is the Subject line"

J1 is a formula which uses concatenate to produce the required email address

Regards

Mark

"Tony Steane" wrote in message
om...
Try changing the wbname = "C=:/" & etc....

to

wbname = "C:\" & etc

ie No = (equals sign) and us the backslash.

Cheers

Tony



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
Auto sending workbook or sheet as an attachment using Outlook Wyveryn Excel Discussion (Misc queries) 1 October 4th 06 03:52 AM
Sheet vs File size when sending email in Outlook matchball Excel Discussion (Misc queries) 0 January 4th 06 07:48 PM
sending mails using outlook Bart van den Burg Excel Programming 1 November 11th 04 12:51 PM
sending an excel sheet via outlook express Alberto Excel Programming 1 August 31st 03 05:46 PM
sending outlook mail bilal Excel Programming 1 July 25th 03 01:16 PM


All times are GMT +1. The time now is 11:44 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"