H
Helmut
Hi...I have the following MACRO where I save one WorkSheet as a *.CSV file
and then want to email it to one receipient.
I have a problem with the DIM Varient/String in order to keep the "Fname"
As it is, it emails a CSV-file but not with the Fname.
thanks - Helmut
------------------
Public Sub DoTheExport()
Dim Fname As Variant
Dim wb As Workbook
Fname = Application.GetSaveAsFilename("c:\MESSER\MESSERmmyy",
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
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SendMail "(e-mail address removed)", _
"This is the Subject line"
.Close False
End With
Kill Fname
Application.ScreenUpdating = True
End Sub
and then want to email it to one receipient.
I have a problem with the DIM Varient/String in order to keep the "Fname"
As it is, it emails a CSV-file but not with the Fname.
thanks - Helmut
------------------
Public Sub DoTheExport()
Dim Fname As Variant
Dim wb As Workbook
Fname = Application.GetSaveAsFilename("c:\MESSER\MESSERmmyy",
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
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SendMail "(e-mail address removed)", _
"This is the Subject line"
.Close False
End With
Kill Fname
Application.ScreenUpdating = True
End Sub