AW: workbook / worksheet
05.07.2012 11:28:45
Hartmut
Hallo Hajo
darf ich Dich einletztes Mal dazu fragen?
das - BoOpen =True und vor End - kann ich nicht platzieren
Nachfolgend meine Macros. was mache ich falsch?
Danke & lieber Gruss
Hartmut
Private Sub Workbook_Open()
BoOpen = True
Sheets("Werberabatt Berechnung").Activate
If Environ("Username") = "lpw" Then
If Range("L38").Value = 1 Then MsgBox _
"Hallo Bernie! Der Nachlass ist über 15% und CHF 125'000. Ein Antrag per Mail ist fällig!!"
If Range("L38").Value = 1 Then
Dim Nachricht As Object, OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim AWS As String
AWS = ThisWorkbook.FullName
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.To = "xxxxxxxxx.xxxx"
.Subject = "Antrag Werberabatt " & " - " & Date & " - " & Time
.attachments.Add AWS
.Body = "Lieber Hartmut." & vbCrLf & "Hurra es ist soweit!" & vbCrLf & "Für diesen _
Kunden darfst Du einen Antrag erstellen." & vbCrLf & "Danke & lieber Gruss" & vbCrLf & "Bernie "
.Display
End With
End If
End If
End Sub
Private Sub Worksheet_Calculate()
If BoOpen = False Then
If Range("l38").Value = 1 Then MsgBox _
"Hallo Bernie! Der Nachlass ist über 15% und CHF 125'000. Ein Antrag per Mail ist fällig!!"
If Range("l38").Value = 1 Then
Dim Nachricht As Object, OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim AWS As String
AWS = ThisWorkbook.FullName
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.To = "xxxxxx.xx"
.Subject = "Antrag Werberabatt " & " - " & Date & " - " & Time
.attachments.Add AWS
.Body = "Lieber Hartmut." & vbCrLf & "Hurra es ist soweit!" & vbCrLf & "Für diesen _
Kunden darfst Du einen Antrag erstellen." & vbCrLf & "Danke & lieber Gruss" & vbCrLf & "Bernie "
.Display
End With
End If
End If
End Sub