Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default E-mail Files From Files

Is there any VBA coding that will allow me to e-mail a file from within
that file?

I want to be able to put a button in an excel file that will let me
e-mail the file it is in to a list of pre-assigned e-mail addresses.

We are a Lotus based e-mail system here, I don't know if that affects
anything.

Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default E-mail Files From Files

Private Sub CommandButton1_Click()
'This will temporarily save the Spreadsheet and then
'e-mail the saved file to someone else
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim wbname As String

' Stop screen updating
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
'Create the temporary file name
wbname = "C:/" & wb1.Name & "" & Format(Now, "dd-mm-yyyy h-mm-ss") &
".xls"
'Save the temporary file
wb1.SaveCopyAs wbname
'Open the temporary file
Set wb2 = Workbooks.Open(wbname)
'using the temporary file create an email
With wb2
.SendMail ", "Subject"
.ChangeFileAccess xlReadOnly
' delete the temporary file
Kill .FullName
.Close False
End With
' start screen updating
Application.ScreenUpdating = True
End Sub


--
Rui Caetano
IT Manager
Township of East Hanover, NJ

"SmartyPants" wrote in message
oups.com...
Is there any VBA coding that will allow me to e-mail a file from within
that file?

I want to be able to put a button in an excel file that will let me
e-mail the file it is in to a list of pre-assigned e-mail addresses.

We are a Lotus based e-mail system here, I don't know if that affects
anything.

Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail Files From Files

Hi SmartyPants

See this site for Lotus code
http://www.excelkb.com/?cNode=1X5M7A

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"SmartyPants" wrote in message oups.com...
Is there any VBA coding that will allow me to e-mail a file from within
that file?

I want to be able to put a button in an excel file that will let me
e-mail the file it is in to a list of pre-assigned e-mail addresses.

We are a Lotus based e-mail system here, I don't know if that affects
anything.

Any help would be appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail Files From Files

See
http://www.rondebruin.nl/mail/prevent.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Freddy" wrote in message ...
Allow me to interject here. I tested successfully the code below. Is there a
way to suppress the dialogue box notifying me that an email is being sent?

"ruic" wrote:

Private Sub CommandButton1_Click()
'This will temporarily save the Spreadsheet and then
'e-mail the saved file to someone else
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim wbname As String

' Stop screen updating
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
'Create the temporary file name
wbname = "C:/" & wb1.Name & "" & Format(Now, "dd-mm-yyyy h-mm-ss") &
".xls"
'Save the temporary file
wb1.SaveCopyAs wbname
'Open the temporary file
Set wb2 = Workbooks.Open(wbname)
'using the temporary file create an email
With wb2
.SendMail ", "Subject"
.ChangeFileAccess xlReadOnly
' delete the temporary file
Kill .FullName
.Close False
End With
' start screen updating
Application.ScreenUpdating = True
End Sub


--
Rui Caetano
IT Manager
Township of East Hanover, NJ

"SmartyPants" wrote in message
oups.com...
Is there any VBA coding that will allow me to e-mail a file from within
that file?

I want to be able to put a button in an excel file that will let me
e-mail the file it is in to a list of pre-assigned e-mail addresses.

We are a Lotus based e-mail system here, I don't know if that affects
anything.

Any help would be appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-mail Files From Files

There is a link to my CDO page there

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Freddy" wrote in message ...
I reviewed the hyperlink and went with Express ClickYes. HOWEVER, is there a
way to do the same thing using VBA code in Excel.

"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Freddy" wrote in message ...
Allow me to interject here. I tested successfully the code below. Is there a
way to suppress the dialogue box notifying me that an email is being sent?

"ruic" wrote:

Private Sub CommandButton1_Click()
'This will temporarily save the Spreadsheet and then
'e-mail the saved file to someone else
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim wbname As String

' Stop screen updating
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
'Create the temporary file name
wbname = "C:/" & wb1.Name & "" & Format(Now, "dd-mm-yyyy h-mm-ss") &
".xls"
'Save the temporary file
wb1.SaveCopyAs wbname
'Open the temporary file
Set wb2 = Workbooks.Open(wbname)
'using the temporary file create an email
With wb2
.SendMail ", "Subject"
.ChangeFileAccess xlReadOnly
' delete the temporary file
Kill .FullName
.Close False
End With
' start screen updating
Application.ScreenUpdating = True
End Sub


--
Rui Caetano
IT Manager
Township of East Hanover, NJ

"SmartyPants" wrote in message
oups.com...
Is there any VBA coding that will allow me to e-mail a file from within
that file?

I want to be able to put a button in an excel file that will let me
e-mail the file it is in to a list of pre-assigned e-mail addresses.

We are a Lotus based e-mail system here, I don't know if that affects
anything.

Any help would be appreciated.





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
Mail Merge from excel to pdf files mrpaps Excel Discussion (Misc queries) 1 May 26th 09 09:51 PM
import iaf files (PST) from a disk to windows mail fmills Excel Discussion (Misc queries) 0 June 22nd 07 05:14 PM
http address for shared files in web mail alfredo Excel Programming 0 January 2nd 06 10:39 PM
Mail a different files to each person in a range [email protected] Excel Worksheet Functions 5 September 2nd 05 02:00 PM
Sending files by e-mail Gareth[_3_] Excel Programming 5 November 3rd 03 02:54 PM


All times are GMT +1. The time now is 10:36 AM.

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"