Hello All,
I have a VBA code that is written for excel 2003. Now we work with Excel 2013 and the code does not work.
I do not have any experience about VBA codes. Any help is appreciated!
Code:
"With Application.FileSearch
.LookIn = sPDFPath 'arama yapılan dizin
.SearchSubFolders = False 'alt klasörler aransın mı
'.FileType = msoFileTypeExcelWorkbooks aranacak dosya türleri
.Filename = "*.pdf" 'aranacak dosya isimleri/uzantıları
If .Execute() > 0 Then
'MsgBox .FoundFiles.Count & " adet dosya bulundu."
For i = 1 To .FoundFiles.Count
OutMail.Attachments.Add .FoundFiles(i)
Next i
Else
MsgBox "Hiç dosya bulunamadı.", vbCritical
End If
End With
.Display
'.Text = "Konu kisminda belirtilen dokumanlarin dagitimi ilgili bolumlere yapilmistir.OK/Onay maili donulmesi."
End With
Set OutMail = Nothing
Set OutApp = Nothing
Sheets("sevkler").Protect Password:="0000"
ThisWorkbook.Save
' SendKeys "^v"
End Sub"
I have a VBA code that is written for excel 2003. Now we work with Excel 2013 and the code does not work.
I do not have any experience about VBA codes. Any help is appreciated!
Code:
"With Application.FileSearch
.LookIn = sPDFPath 'arama yapılan dizin
.SearchSubFolders = False 'alt klasörler aransın mı
'.FileType = msoFileTypeExcelWorkbooks aranacak dosya türleri
.Filename = "*.pdf" 'aranacak dosya isimleri/uzantıları
If .Execute() > 0 Then
'MsgBox .FoundFiles.Count & " adet dosya bulundu."
For i = 1 To .FoundFiles.Count
OutMail.Attachments.Add .FoundFiles(i)
Next i
Else
MsgBox "Hiç dosya bulunamadı.", vbCritical
End If
End With
.Display
'.Text = "Konu kisminda belirtilen dokumanlarin dagitimi ilgili bolumlere yapilmistir.OK/Onay maili donulmesi."
End With
Set OutMail = Nothing
Set OutApp = Nothing
Sheets("sevkler").Protect Password:="0000"
ThisWorkbook.Save
' SendKeys "^v"
End Sub"