Hello! Does anyone have any idea why my script (triggered by a button in a picture) works fine and with the same code in a global script doesnt work? As a trigger in global script I have tried both clockwise and by tag. I can se the script going and there is a fault message just telling me "Error with no explanation". The script is used to sent mail internally in our company with some snapshot-data. As I said, works fine with button-action in picture but not as a global script (with trigger). WinCC 7 SP2 with Windows 7 Ulimate... ________________________________________________________________________ Here is my button-action (with dummy-mail-adress) Sub OnLButtonDown(Byval Item, Byval Flags, Byval x, Byval y) Dim objMessage Dim receiver_2 Dim mess mess = "test" receiver_2 = HMIRuntime.Tags("Receiver_2").Read If receiver_2 <> "" Then Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Automatiskt mail från process-styrning" objMessage.Sender = "mail@mail.com" objMessage.To = receiver_2 objMessage.TextBody = "Mail från: " & vbCrLf & vbCrLf & mess objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "C23.mail.com" objMessage.Configuration.Fields.Update objMessage.Send End If End Sub ___________________________________________________________________________________________ Here is the G-S (with dummy-mail-adress) Option Explicit Function action Dim objMessage Dim receiver_2 Dim mess mess = "test" receiver_2 = HMIRuntime.Tags("receiver_2").Read If receiver_2 <> "" Then Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Automatiskt mail från process-styrning" objMessage.Sender = "mail@mail.com" objMessage.To = receiver_2 objMessage.TextBody = "Mail från: " & vbCrLf & vbCrLf & mess objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "C23.mail.com" objMessage.Configuration.Fields.Update objMessage.Send End If End Function ____________________________________________________ Some inputs anyone? Regards, MaPe