Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default emailing Spreadsheet?

I have an access database that spits out an excel file to
my C drive...is there a way that I can have this file
automatically emailed to someone?

I checked the access NG and they said to check here
because the file was now an excel file.

I want to run the access database
It spits out the excel file and automatically emails it to
certain people.

Thanks for all your help.
Scott
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default emailing Spreadsheet?

Hi scott

If you use Outlook??

I think you can use this without any problems in Access VBA


Sub Mail_workbook_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
'You can add files like this
.Attachments.Add ("C:\test.xls")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"scott" wrote in message ...
I have an access database that spits out an excel file to
my C drive...is there a way that I can have this file
automatically emailed to someone?

I checked the access NG and they said to check here
because the file was now an excel file.

I want to run the access database
It spits out the excel file and automatically emails it to
certain people.

Thanks for all your help.
Scott



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default emailing Spreadsheet?

Thank you for this info..I do have one question..Where do
I put the code and how do I run it? I tried copying it
into a macro and using RUN CODE in macro like this

RUNCODE Mail_workbook_Outlook()

but I got an error.

I am using access 97.

Thank you for all your help.

Scott
-----Original Message-----
Hi scott

If you use Outlook??

I think you can use this without any problems in Access

VBA


Sub Mail_workbook_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
'You can add files like this
.Attachments.Add ("C:\test.xls")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"scott" wrote in

message ...
I have an access database that spits out an excel file

to
my C drive...is there a way that I can have this file
automatically emailed to someone?

I checked the access NG and they said to check here
because the file was now an excel file.

I want to run the access database
It spits out the excel file and automatically emails it

to
certain people.

Thanks for all your help.
Scott



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default emailing Spreadsheet?

The code you must place in a normal module
Did you add a reference to Outlook?

1) Go to the VBA editor, Alt -F11
2) ToolsReferences in the Menu bar
3) Place a Checkmark before Microsoft Outlook ? Object Library
? is the Excel version number



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"scott" wrote in message ...
Thank you for this info..I do have one question..Where do
I put the code and how do I run it? I tried copying it
into a macro and using RUN CODE in macro like this

RUNCODE Mail_workbook_Outlook()

but I got an error.

I am using access 97.

Thank you for all your help.

Scott
-----Original Message-----
Hi scott

If you use Outlook??

I think you can use this without any problems in Access

VBA


Sub Mail_workbook_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
'You can add files like this
.Attachments.Add ("C:\test.xls")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"scott" wrote in

message ...
I have an access database that spits out an excel file

to
my C drive...is there a way that I can have this file
automatically emailed to someone?

I checked the access NG and they said to check here
because the file was now an excel file.

I want to run the access database
It spits out the excel file and automatically emails it

to
certain people.

Thanks for all your help.
Scott



.



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
Emailing PART of a spreadsheet dsosb Excel Discussion (Misc queries) 5 January 20th 10 04:51 PM
emailing spreadsheet Kathy Excel Discussion (Misc queries) 0 July 29th 08 01:56 PM
emailing from existing spreadsheet ACE@MV Excel Discussion (Misc queries) 3 June 26th 06 06:40 PM
Emailing a spreadsheet Chip Smith Excel Discussion (Misc queries) 1 June 7th 06 07:55 PM
Emailing a form from a spreadsheet daiblackburn Links and Linking in Excel 0 June 7th 05 08:11 AM


All times are GMT +1. The time now is 04:16 AM.

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"