Bu hatanın kaynağı ne olabilir, arkadaşımın bilgisayarında açıyorum aynı ofis sürümü 2013, hata vermiyor. Benim bilgisayarımda açtığımda hata alıyorum. Otomatik başlangıç mesajı gelmesi gerek gelmiyor. Çalışma kitabında aşağıdaki kodlar var.
Kod:
Sub Basa_Don()
Sheets("KPI").Activate
Range("A1").Select
End Sub
Private Sub Workbook_Open()
Basa_Don.Basa_Don
Baslangic_Mesaji.Baslangic_Mesaji
End Sub
Sub InsertRow()
ActiveSheet.Unprotect Password:="*123"
Application.ScreenUpdating = False
Dim sObject As Shape
Application.ScreenUpdating = False
Application.CopyObjectsWithCells = False
For Each sObject In ActiveSheet.Shapes
sObject.Visible = False
Next
ActiveSheet.Shapes(Application.Caller).TopLeftCell.Rows.EntireRow.Select
Selection.EntireRow.Copy
Selection.EntireRow.Insert
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
For Each sObject In ActiveSheet.Shapes
sObject.Visible = True
Next
Application.CopyObjectsWithCells = True
Application.ScreenUpdating = True
Application.ScreenUpdating = True
ActiveSheet.Protect Password:="*123"
End Sub
Sub Baslangic_Mesaji()
MsgBox "WELCOME TO MAINTENANCE ANALYSIS"
End Sub
Function TCMB_Kur(Tarih As Date, DovTip As String, Tipi As String) As Variant
Sheets("KPI").Unprotect Password:="*123"
Dim xDoc As Object
Set xDoc = CreateObject("MSXML2.DOMDocument")
xDoc.async = False
xDoc.validateOnParse = False
If Tarih = Date Then
strURL = "http://www.tcmb.gov.tr/kurlar/today.xml"
Else
If Weekday(Tarih, vbMonday) = 6 Then
Tarih = Tarih - 1
ElseIf Weekday(Tarih, vbMonday) = 7 Then
Tarih = Tarih - 2
End If
myDay = Format(Day(CDate(Tarih + 0)), "00")
myMonth = Format(CDate(Month(Tarih + 0)), "00")
myYear = Year(CDate(Tarih + 0))
strURL = "http://www.tcmb.gov.tr/kurlar/" & myYear & myMonth & "/" & myDay & myMonth & myYear & ".xml"
End If
xDoc.Load strURL
Set KurListesi = xDoc.DocumentElement
Select Case DovTip
Case Is = "USD"
Select Case Tipi
Case Is = "Döviz Alış"
RetVal = KurListesi.ChildNodes(0).ChildNodes(3).Text
Case Is = "Döviz Satış"
RetVal = KurListesi.ChildNodes(0).ChildNodes(4).Text
Case Is = "Efektif Alış"
RetVal = KurListesi.ChildNodes(0).ChildNodes(5).Text
Case Is = "Efektif Satış"
RetVal = KurListesi.ChildNodes(0).ChildNodes(6).Text
End Select
Case Is = "EUR"
Select Case Tipi
Case Is = "Döviz Alış"
RetVal = KurListesi.ChildNodes(3).ChildNodes(3).Text
Case Is = "Döviz Satış"
RetVal = KurListesi.ChildNodes(3).ChildNodes(4).Text
Case Is = "Efektif Alış"
RetVal = KurListesi.ChildNodes(3).ChildNodes(5).Text
Case Is = "Efektif Satış"
RetVal = KurListesi.ChildNodes(3).ChildNodes(6).Text
End Select
Case Is = "GBP"
Select Case Tipi
Case Is = "Döviz Alış"
RetVal = KurListesi.ChildNodes(4).ChildNodes(3).Text
Case Is = "Döviz Satış"
RetVal = KurListesi.ChildNodes(4).ChildNodes(4).Text
Case Is = "Efektif Alış"
RetVal = KurListesi.ChildNodes(4).ChildNodes(5).Text
Case Is = "Efektif Satış"
RetVal = KurListesi.ChildNodes(4).ChildNodes(6).Text
End Select
End Select
Sheets("KPI").Protect Password:="*123"
TCMB_Kur = Replace(RetVal, ".", ",") + 0
End Function