Skip to content

Instantly share code, notes, and snippets.

@Talha-T
Created May 31, 2017 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Talha-T/57ea8566119d6d8d905262de3617ad47 to your computer and use it in GitHub Desktop.
Save Talha-T/57ea8566119d6d8d905262de3617ad47 to your computer and use it in GitHub Desktop.
Makro
Option Explicit
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Attachments.Count < 1 Then Exit Sub
Dim app As New Excel.Application
app.Workbooks.Open ("C:\Users\CADCAM\Desktop\Kesim Takip Listesi.xlsx")
Dim dosyaAdı As String
dosyaAdı = Item.Attachments(1)
Dim isim, kalınlık, adet As String
' elevatör ara oluk(2mm 4 adet)
Dim parantez As Integer
parantez = InStr(dosyaAdı, "(")
isim = Mid(dosyaAdı, 1, parantez - 1)
Dim sonrakiBoşluk As Integer
sonrakiBoşluk = InStr(parantez, dosyaAdı, " ")
kalınlık = Mid(dosyaAdı, parantez + 1, sonrakiBoşluk - 1 - parantez)
Dim kapamaParantezi As Integer
kapamaParantezi = InStr(dosyaAdı, ")")
adet = Mid(dosyaAdı, sonrakiBoşluk + 1, kapamaParantezi - sonrakiBoşluk - 1)
Dim başlangıç As Integer
başlangıç = Excel.Cells(2, 6)
Excel.Cells(başlangıç, 1) = isim
Excel.Cells(başlangıç, 2) = kalınlık
Excel.Cells(başlangıç, 3) = adet
Excel.Cells(başlangıç, 4) = Now
Excel.Cells(2, 6) = başlangıç + 1
Excel.Calculate
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment