- Katılım
- 1 Aralık 2010
- Mesajlar
- 313
- Excel Vers. ve Dili
- Office 2010
Aşağıdaki kodu çalıştırmak istediğimde "variable not defined" hatası alıyorum. Nedeni ne olabilir?
http://www.dosya.tc/server24/HVazfs/VARIABLE.JPG.html
http://www.dosya.tc/server24/HVazfs/VARIABLE.JPG.html
Kod:
Option Explicit
Sub Dosyalardaki_Adlari_Temizle()
Dim Yol As String
Dim Dosya As String
Dim Hedef_Dosya As Workbook
Yol = ThisWorkbook.Path
On Error Resume Next
Dosya = Dir(Yol & "\*.xls")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
While Dosya <> ""
If Dosya <> "TEST.xls" Then
DoEvents
Set Hedef_Dosya = Workbooks.Open(Yol & "\" & Dosya, False, False)
With Hedef_Dosya
For Each Ad In .Names
Ad.Delete
Next
End With
Hedef_Dosya.Close True
End If
Dosya = Dir
Wend
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "Klasördeki tüm dosyalarınızdaki ad tanımlamaları temizlenmiştir.", vbInformation
End Sub