Y
Yngve
Hi al
The combination of Ron De Bruin "Mail_ActiveSheet" and Pearson
"DeleteAllCodeInModule"
is an briliant solution for me. Now I can send only the sheet whitout
code`s behind.
Manny thanks to both of you.
If other need`s the code !!!
Sub Mail_ActiveSheet()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
DeleteAllCodeInModule
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail "(e-mail address removed)", _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub
' referanse = "Microsoft Visual
'Basic For Applications Extensibility 5.3".
Sub DeleteAllCodeInModule()
Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim HowManyLines As Long
Set VBCodeMod = ActiveWorkbook.VBProject. _
VBComponents("Ark1").CodeModule
With VBCodeMod
StartLine = 1
HowManyLines = .CountOfLines
.DeleteLines StartLine, HowManyLines
End With
End Sub
Regards Yngve
The combination of Ron De Bruin "Mail_ActiveSheet" and Pearson
"DeleteAllCodeInModule"
is an briliant solution for me. Now I can send only the sheet whitout
code`s behind.
Manny thanks to both of you.
If other need`s the code !!!
Sub Mail_ActiveSheet()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
DeleteAllCodeInModule
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail "(e-mail address removed)", _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub
' referanse = "Microsoft Visual
'Basic For Applications Extensibility 5.3".
Sub DeleteAllCodeInModule()
Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim HowManyLines As Long
Set VBCodeMod = ActiveWorkbook.VBProject. _
VBComponents("Ark1").CodeModule
With VBCodeMod
StartLine = 1
HowManyLines = .CountOfLines
.DeleteLines StartLine, HowManyLines
End With
End Sub
Regards Yngve