H
Helmut
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\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 'this creates the CSV file with
"Fname"
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
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\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 'this creates the CSV file with
"Fname"
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