LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Email a CSV file

Hi - I'm creating a CSV file with 'Fname'
then I want to email it. The macro below creates the csv file BUT I can't
retain the 'Fname' for the file for emailing. it's something to do with the
DIM
Helmut PLEASE
------------------
Public Sub DoTheExport()
Dim Fname As Variant
Dim wb As Workbook

Fname = Application.GetSaveAsFilename("c:\MESSER\MESSERmmy y",
fileFilter:="CSV Files (*.csv), *.csv")

If Fname = False Then
MsgBox "You didn't select a file"
Exit Sub
End If

'Running the Public Sub below
ExportToTextFile CStr(Fname), ",", False 'this creates the CSV file with
"Fname"

Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SendMail ", _
"This is the Subject line"
.Close False
End With
Kill Fname
Application.ScreenUpdating = True
End Sub
 
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
how to send file to email shaz0503 Excel Discussion (Misc queries) 0 June 30th 09 10:43 PM
convert email address file in Excel 2000 to Word file with commas Mike A. Excel Discussion (Misc queries) 8 October 14th 08 02:48 PM
Email excel file help RTRANS Excel Discussion (Misc queries) 1 July 23rd 08 09:41 PM
Add to zip file and email krabople Excel Programming 15 January 21st 06 10:28 AM
How to email A file Ussiddiqui[_7_] Excel Programming 4 January 29th 04 06:35 PM


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