Thread: E-Mail
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default E-Mail

You could do it very easily.
set up a folder on your network that your users have write access to. In
this folder you may want sub-folders whose names are datestamps...eg 20050315
This is useful as they are easy to sort & check.

Each work book can now have some very simple code to generate a text file
which is saved in the datestamped folder

This code in the user's workbook...its not sophisticated since we're using
various versions of Office and/or Excel...so kept simple:

Sub Submit_Data()
Dim sFileName As String
Dim text As String, vText As Variant
Dim rw As Long
Dim cl As Long

Const FileName As String = "H:\MyData\DATESTAMP\USER_Data.txt"

sFileName = Replace(FileName, "USER", Environ$("username"))
sFileName = Replace(sFileName, "DATESTAMP", Format$(Date, "YYYYMMDD"))

Open sFileName For Output As #1

For rw = 1 To 30
text = ""
For cl = 1 To 5
text = text & "," & Cells(rw, cl)
Next
text = Mid(text, 2)
Print #1, text
Next
Close

End Sub

you'll need to set the rows/columns etc but this tested OK

Your own workbook will need to read in all the data...follows...









"Roger" wrote:

I receive via e-mail 25 spreadsheets every week to consolidate into a group
report. I have constant problems with idiots forgetting to attach the file,
attaching the wrong file, attaching the shortcut. I have been experimenting
with automating the sending of these files to me. However,having read and
tried many of the suggestions on e-mailing with zero success, am I asking too
much to devise code that would work on all these different PC's with
different mailers and very varied versions of windows & office.
--
Roger