Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic/VBA to drive the email subject with excel

Anonymous

iLogic/VBA to drive the email subject with excel

Anonymous
Not applicable

Hello there!

I have this rule to make a attach on a email and and the subject to: "Glas position X"

X = parameter from excel (You have te excel attached on my posrt)

Can you tell me whats wrong with zhe gode it doesen work

 

 

Sub Mailversand()

 

Dim Nachricht As Object, OutlookApplication As Object
Set OutlookApplication = CreateObject("Outlook.Application")
Set Nachricht = OutlookApplication.CreateItem(0)
With Nachricht

 

Dim oPos As String
Set oPos = GoExcel.CellValue("C:\Users\user\Desktop\Book 1.xlsx", "Sheet1", "B1")
With oOMail
.Subject = "Glas position" & oPos

.

To = "test@test.de"
.Body = "Sehr geehrte Damen und Herren"
.Attachments.Add "C:\Users\user\Desktop\Neuer Ordner\Ablehnung der ZAV an Fieger am 29.01.2015.pdf"

'.Body = "Mailtext"
.Display
'.Mail.Send
End With
Set OutlookApplication = Nothing
Set Nachricht = Nothing

End Sub

0 Likes
Reply
440 Views
2 Replies
Replies (2)

rossano_praderi
Collaborator
Collaborator

You have to use an Ilogic rule in order to use this Ilogic function "GoExcel.CellValue...".

 

Last week, I've sent you a private msg with code and explainations on how to do it.

 

This is your original VBA subroutine converted in Ilogic code, change it as you need...

Private Sub Mailversand()
Dim OlApp As Object = CreateObject("Outlook.Application")
Dim Nachricht As Object = OlApp.CreateItem(0)
	With Nachricht
		'.To = "test@test.de"
		'.Subject = "Betreff "
		.attachments.Add(sFile)
		'.attachments.Add(pFile)
'		.attachments.Add("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Steps\Glashalter oben.stp")
'		.attachments.Add("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Steps\Glashalter unten.stp")
'		.attachments.Add("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Zeichnungen\Glashalter oben.pdf")
'		.attachments.Add("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Zeichnungen\Glashalter unten.pdf")
'		.attachments.Add("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Zeichnungen\Glashalter mitte.pdf")
		'.Body = "Mailtext"
		.Display
		'.Mail.Send
	End With
OlApp = Nothing
Nachricht = Nothing
End Sub

Please, stop spamming the forum with the same questions.

 

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes

Anonymous
Not applicable

han you for the reply

 

is there a way then to make a single rule for email and with "goExcel rule"?

Wheni run the rule in iLogic (and also in VBA) i bekomme a error with the Sub

The sub ist then yellow and i dont know what it meians

0 Likes