Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Excel / VBA to automatically email forms - how?

I am currently in the planning stages of a small project at work. Le
me explain the project quickly.. I'd like to get some input if
could:

At my work, we have a warehouse that houses all of our parts for ou
equipment. The problem is this: the guys that work in the warehous
do not have a system to monitor what goes in and out (except for
terrible paperwork 'system' they use). We don't know when we run ou
of parts until we actually run out - which is not funny, as you ca
imagine!

My idea is this: I want to set up a simple excel list of part number
that our inventory staff won't freak out on (ins and outs, etc.).
Basically, when a box of parts is received, I want them to look up th
specific part number and add to its total in their excel spreadsheet.
When a part is removed from the warehouse, they would subtract fro
that specific part number's total. Seems easy for most, right? You'
be surpised with our guys!

I would then like to have a second excel worksheet (locked, of course!
that would retrieve the part number totals. When these parts get belo
a certain quantity, this excel worksheet would then send an email t
the people that are responsible for ordering parts. This workshee
would contain all the part numbers, and each part number would hav
information with it such as Supplier info, costs, wait time, etc. Thi
email would provide all the information needed to make the order
nothing more.

Can I do this? Can I have excel somehow send out these email
automatically when these minimum part quantities occur?

Any ideas suggestions are *much* appreciated!

Andre

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Excel / VBA to automatically email forms - how?

Ron de Bruin's site

http://www.rondebruin.nl/sendmail.htm
http://www.rondebruin.nl/index.html

an Article by Ron on MSDN:
http://msdn.microsoft.com/library/en...odc_xlmail.asp

Dick Kusileka's site
http://www.dicks-clicks.com


Show the mechanics of sending an email.

You can use the change event in your code to trigger the determination of
when to send it.

This explains events (Chip Pearson's site)

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


funperro wrote in message
...
I am currently in the planning stages of a small project at work. Let
me explain the project quickly.. I'd like to get some input if I
could:

At my work, we have a warehouse that houses all of our parts for our
equipment. The problem is this: the guys that work in the warehouse
do not have a system to monitor what goes in and out (except for a
terrible paperwork 'system' they use). We don't know when we run out
of parts until we actually run out - which is not funny, as you can
imagine!

My idea is this: I want to set up a simple excel list of part numbers
that our inventory staff won't freak out on (ins and outs, etc.).
Basically, when a box of parts is received, I want them to look up the
specific part number and add to its total in their excel spreadsheet.
When a part is removed from the warehouse, they would subtract from
that specific part number's total. Seems easy for most, right? You'd
be surpised with our guys!

I would then like to have a second excel worksheet (locked, of course!)
that would retrieve the part number totals. When these parts get below
a certain quantity, this excel worksheet would then send an email to
the people that are responsible for ordering parts. This worksheet
would contain all the part numbers, and each part number would have
information with it such as Supplier info, costs, wait time, etc. This
email would provide all the information needed to make the order,
nothing more.

Can I do this? Can I have excel somehow send out these emails
automatically when these minimum part quantities occur?

Any ideas suggestions are *much* appreciated!

Andrew


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Excel / VBA to automatically email forms - how?

Tom -

Thanks for your quick reply. I glanced over the links and am stil
wondering if its possible to send email through excel - or is a clien
necessary?

Thanks -
Andre

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Excel / VBA to automatically email forms - how?

Excel doesn't provide any specific capability for it, but if you look at
Ron's information on CDO, it doesn't necessarily need a client, but it does
need the underlying foundations such as smtp.

--
Regards,
Tom Ogilvy

funperro wrote in message
...
Tom -

Thanks for your quick reply. I glanced over the links and am still
wondering if its possible to send email through excel - or is a client
necessary?

Thanks -
Andrew


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Excel / VBA to automatically email forms - how?

Ok. I have figured out how to make it send an email via CDO. It work
great! Now I have another question - I'm a beginner when it comes t
programm VBA, so please bear with me. I don't understand how t
actually have my VB app or macro or whatever you want to call it t
run. Right now, my program will only go through and send out an emai
if I hit alt-F11 and then click run. How do I make this macro run b
itself? Is there a way to make the macro run when closing the file?
How about when opening the file?

Any help is appreciated -
Andre

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Excel / VBA to automatically email forms - how?

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on Events.

--
Regards,
Tom Ogilvy

funperro wrote in message
...
Ok. I have figured out how to make it send an email via CDO. It works
great! Now I have another question - I'm a beginner when it comes to
programm VBA, so please bear with me. I don't understand how to
actually have my VB app or macro or whatever you want to call it to
run. Right now, my program will only go through and send out an email
if I hit alt-F11 and then click run. How do I make this macro run by
itself? Is there a way to make the macro run when closing the file?
How about when opening the file?

Any help is appreciated -
Andrew


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Excel / VBA to automatically email forms - how?

Tom -

Thanks for the link.. I actually have read that page many many times.
Forgive me - but this is my first time working with events.. an
actually, the first time using VBA.

So far, the code I have come up with will run the macro when making
change to the worksheet. I would like this to run the macro only upo
closure of the workbook. Any suggestions on what I should change? B
the way, all of this code is placed in "Sheet1".

Thanks for *any* help anyone can and / or has provided!
Andrew


Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Application.EnableEvents = False
Call CDO_Send
Application.EnableEvents = True
End Sub


Sub CDO_Send()

Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Dim cell As Range

Application.ScreenUpdating = False

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "163.186.80.4"
.Item(cdoSMTPServerPort) = 25
.Update
End With
For Each cell I
Sheets("Sheet1").Columns("J").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And cell.Offset(0, 1).Value
"yes" Then
With iMsg
Set .Configuration = iConf
.To = cell.Value
.From = """Inventario de Almacen"" <"
.Subject = "Comprar Partes"
.TextBody = "Dear " & cell.Offset(0, -1).Value & vbNewLine
vbNewLine & _
"Part number needs to be ordered."
.Send
End With
End If
End If
Next cell

Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Su

--
Message posted from http://www.ExcelForum.com

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
Need to automatically number order forms in excel upon opening? Mike1 Excel Discussion (Misc queries) 2 May 16th 06 07:59 PM
Email, forms, Excel, Infopath, Sharepoint Bettergains Excel Discussion (Misc queries) 0 November 10th 05 10:24 PM
Excel 97 generating email automatically starts Lotus 6. DefaultOK Simon Starter Excel Discussion (Misc queries) 1 August 25th 05 08:43 PM
How do I automatically send daily email of updated Excel workbook. How to automate emails with excel file. Excel Discussion (Misc queries) 1 May 9th 05 08:55 PM
Excel Forms - text fields decompressing font automatically EM Excel Discussion (Misc queries) 0 March 11th 05 03:37 PM


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