Option Explicit
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Boolean
Public Function GetNISExchangeRate(Optional dtDate As Date = #1/1/1900#, Optional strCurr As String = "01") As Double
Dim strURL As String
Dim strResult As String
Dim pos As Long
Dim strSearch As String
Dim dtPreviousDate As Date
Dim i As Integer
strSearch = Chr(60) & "RATE" & Chr(62)
If dtDate = #1/1/1900# Then
dtDate = Date
End If
Select Case strCurr
Case "01", "02", "03", "05", "06", "12", "17", "18", "27", "28", "31", "69", "70", "79"
Case Else
MsgBox "קוד מטבע לא חוקי!", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
Exit Function
End Select
If IsConnected Then
strURL = "http://www.boi.org.il/currency.xml?rdate=" & Format(IIf(dtPreviousDate > 1, dtPreviousDate, dtDate), "YYYYMMDD") & "&curr=" & strCurr
strResult = GetHTML(strURL)
If InStr(1, strResult, strSearch) < 1 Then
For i = 1 To 6
dtPreviousDate = dtDate - i
strURL = "http://www.boi.org.il/currency.xml?rdate=" & Format(dtPreviousDate, "YYYYMMDD") & "&curr=" & strCurr
strResult = GetHTML(strURL)
If InStr(1, strResult, strSearch) > 0 Then Exit For
Next i
End If
Else
MsgBox "לא זוהה חיבור לאינטרמת!", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
End If
If Len(strResult) > 0 Then
pos = InStr(1, strResult, strSearch, vbTextCompare)
If pos > -1 Then
GetNISExchangeRate = ExtractNumber(Mid(strResult, pos + Len(strSearch), 5)) ' / 1000
End If
End If
End Function
Function IsConnected() As Boolean
Dim Stat As Long
IsConnected = (InternetGetConnectedState(Stat, 0&) <> 0)
End Function
Function GetHTML(strURL As String) As String
Dim HTML As String
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", strURL, False
.Send
GetHTML = .ResponseText
End With
End Function
Function ExtractNumber(strText As String)
Dim iCount As Integer, i As Integer
Dim lNum As String
For iCount = Len(strText) To 1 Step -1
If IsNumeric(Mid(strText, iCount, 1)) Then
i = i + 1
lNum = Mid(strText, iCount, 1) & lNum
Else
If Mid(strText, iCount, 1) = Chr(46) Then
i = i + 1
lNum = Mid(strText, iCount, 1) & lNum
End If
End If
If i = 1 Then lNum = CDbl(Mid(lNum, 1, 1))
Next iCount
ExtractNumber = CDbl(lNum)
End Function
Option Explicit
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Boolean
Public Function GetNISExchangeRate(Optional dtDate As Date = #1/1/1900#, Optional strCurr As String = "01") As Double
Dim strURL As String
Dim strResult As String
Dim pos As Long
Dim strSearch As String
Dim dtPreviousDate As Date
Dim i As Integer
strSearch = Chr(60) & "RATE" & Chr(62)
If dtDate = #1/1/1900# Then
dtDate = Date
End If
Select Case strCurr
Case "01", "02", "03", "05", "06", "12", "17", "18", "27", "28", "31", "69", "70", "79"
Case Else
MsgBox "קוד מטבע לא חוקי", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
Exit Function
End Select
If IsConnected Then
strURL = "http://www.boi.org.il/currency.xml?rdate=" & Format(IIf(dtPreviousDate > 1, dtPreviousDate, dtDate), "YYYYMMDD") & "&curr=" & strCurr
strResult = GetHTML(strURL)
If InStr(1, strResult, strSearch) < 1 Then
For i = 1 To 6
dtPreviousDate = dtDate - i
strURL = "http://www.boi.org.il/currency.xml?rdate=" & Format(dtPreviousDate, "YYYYMMDD") & "&curr=" & strCurr
strResult = GetHTML(strURL)
If InStr(1, strResult, strSearch) > 0 Then Exit For
Next i
End If
Else
MsgBox "לא זוהה חיבור לאינטרנט!", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
End If
If Len(strResult) > 0 Then
pos = InStr(1, strResult, strSearch, vbTextCompare)
If pos > -1 Then
GetNISExchangeRate = ExtractNumber(Mid(strResult, pos + Len(strSearch), 5)) ' / 1000
End If
End If
End Function
Function IsConnected() As Boolean
Dim Stat As Long
IsConnected = (InternetGetConnectedState(Stat, 0&) <> 0)
End Function
Function GetHTML(strURL As String) As String
Dim HTML As String
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", strURL, False
.Send
GetHTML = .ResponseText
End With
End Function
Function ExtractNumber(strText As String)
Dim iCount As Integer, i As Integer
Dim lNum As String
For iCount = Len(strText) To 1 Step -1
If IsNumeric(Mid(strText, iCount, 1)) Then
i = i + 1
lNum = Mid(strText, iCount, 1) & lNum
Else
If Mid(strText, iCount, 1) = Chr(46) Then
i = i + 1
lNum = Mid(strText, iCount, 1) & lNum
End If
End If
If i = 1 Then lNum = CDbl(Mid(lNum, 1, 1))
Next iCount
ExtractNumber = CDbl(lNum)
End Function
נכתב ע"י moishy;1322602:מבדיקות שערכתי על מחשבים נוספים מתברר ש...
הקוד מתחיל לעבוד כראוי לאחר פתיחת הקישור באופן ידני בדפדפן. נכון לרגע זה אין לי הסבר לתופעה.
Function GetRate(AtDate As String, curr As String) As Double
Dim doc As New MSXML2.DOMDocument60
doc.async = False
doc.Load ("http://www.boi.org.il/currency.xml?rdate=" & AtDate & "&curr=" & curr)
GetRate = doc.SelectSingleNode(".//RATE").Text
End Function
Option Explicit
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Boolean
Function GetNISExchangeRate(Optional dtDate As Date = #1/1/1900#, Optional strCurr As String = "01") As Double
Dim objXMLDoc As Object
Dim objNode As Object
Dim strUrl As String
Dim dtPreviousDate As Date
Dim i As Long
Set objXMLDoc = CreateObject("MSXML2.DOMDocument.6.0")
If dtDate = #1/1/1900# Then
dtDate = Date
End If
Select Case strCurr
Case "01", "02", "03", "05", "06", "12", "17", "18", "27", "28", "31", "69", "70", "79"
Case Else
MsgBox "קוד מטבע לא חוקי", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
Exit Function
End Select
If IsConnected Then
strUrl = "http://www.boi.org.il/currency.xml?rdate=" & Format(IIf(dtPreviousDate > 1, dtPreviousDate, dtDate), "YYYYMMDD") & "&curr=" & strCurr
objXMLDoc.async = False
objXMLDoc.Load strUrl
Set objNode = objXMLDoc.SelectSingleNode("//RATE")
Do Until Not objNode Is Nothing
dtPreviousDate = dtDate - i
strUrl = "http://www.boi.org.il/currency.xml?rdate=" & Format(dtPreviousDate, "YYYYMMDD") & "&curr=" & strCurr
objXMLDoc.Load strUrl
Set objNode = objXMLDoc.SelectSingleNode("//RATE")
i = i + 1
Loop
Else
MsgBox "לא זוהה חיבור לאינטרנט!", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
End If
GetNISExchangeRate = objXMLDoc.SelectSingleNode("//RATE").Text
End Function
Function IsConnected() As Boolean
Dim Stat As Long
IsConnected = (InternetGetConnectedState(Stat, 0&) <> 0)
End Function
Option Explicit
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Boolean
Function GetNISExchangeRate(Optional dtDate As Date = #1/1/1900#, Optional strCurr As String = "01") As Double
Dim objXMLDoc As Object
Dim objNode As Object
Dim strUrl As String
Dim dtPreviousDate As Date
Dim i As Long
Set objXMLDoc = CreateObject("MSXML2.DOMDocument.6.0")
If dtDate = #1/1/1900# Then
dtDate = Date
End If
Select Case strCurr
Case "01", "02", "03", "05", "06", "12", "17", "18", "27", "28", "31", "69", "70", "79"
Case Else
MsgBox "קוד מטבע לא חוקי", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
Exit Function
End Select
If IsConnected Then
strUrl = "http://www.boi.org.il/currency.xml?rdate=" & Format(IIf(dtPreviousDate > 1, dtPreviousDate, dtDate), "YYYYMMDD") & "&curr=" & strCurr
With CreateObject("InternetExplorer.Application")
.Visible = False
.Navigate strUrl
Do Until .Busy = False And .ReadyState = 4
DoEvents
Loop
.Quit
End With
objXMLDoc.async = False
objXMLDoc.Load strUrl
Set objNode = objXMLDoc.SelectSingleNode("//RATE")
Do Until Not objNode Is Nothing
dtPreviousDate = dtDate - i
strUrl = "http://www.boi.org.il/currency.xml?rdate=" & Format(dtPreviousDate, "YYYYMMDD") & "&curr=" & strCurr
objXMLDoc.Load strUrl
Set objNode = objXMLDoc.SelectSingleNode("//RATE")
i = i + 1
Loop
Else
MsgBox "ìà æåää çéáåø ìàéðèøðè!", vbCritical + vbMsgBoxRtlReading + vbMsgBoxRight
End If
GetNISExchangeRate = objXMLDoc.SelectSingleNode("//RATE").Text
End Function
Function IsConnected() As Boolean
Dim Stat As Long
IsConnected = (InternetGetConnectedState(Stat, 0&) <> 0)
End Function
לוח לימודים
מסלולי לימוד שאפשר לההצטרף
אליהם ממש עכשיו:
8.05
ל' ניסן
פתיחת מסלול
אוטומציות עסקיות, בוטים והטמעת מערכות מידע
מלגות גבוהות!
9.05
א' אייר
הנחת ענק!
ירושלמי?
יש לנו מלגה מטורפת עבורך! קורס במימון כמעט מלא!!
ההרשמה בעיצומה
28.05
כ' אייר
פתיחת מסלול מורחב:
פיתוח ובניית אתרים
מלגות גבוהות!
2.06
כ"ה אייר
פתיחת מסלול
קורס עריכת וידאו
מלגות והנחות משמעותיות!
24.06
י"ח סיוון
פתיחת מסלול
מאסטר בשיווק דיגיטלי
מלגות גבוהות!
27.06
כ"א סיוון
פתיחת מסלול
עיצוב ואדריכלות פנים
מלגות גבוהות!
27.06
כ"א סיוון
השקה חגיגית!
עיצוב גרפי ודיגיטל - בסילבוס חדש ומטורף!
מלגות גבוהות!
7.05
כ"ט ניסן
#רקבפרוג
הרצאה מרתקת:
מלחמה מבעד לעדשה
עם אילן לורנצי
שיתוף מטלטל ומיוחד על צילומים בזמן מלחמה ותיעודים יותאי דופן זווית יוצאת דופן מתוך עזה והעוטף ועד הצפון
לתלמידים ובוגרים בלבד!
תהילים פרק קלב
א שִׁיר הַמַּעֲלוֹת זְכוֹר יְהוָה לְדָוִד אֵת כָּל עֻנּוֹתוֹ:ב אֲשֶׁר נִשְׁבַּע לַיהוָה נָדַר לַאֲבִיר יַעֲקֹב:ג אִם אָבֹא בְּאֹהֶל בֵּיתִי אִם אֶעֱלֶה עַל עֶרֶשׂ יְצוּעָי:ד אִם אֶתֵּן שְׁנַת לְעֵינָי לְעַפְעַפַּי תְּנוּמָה:ה עַד אֶמְצָא מָקוֹם לַיהוָה מִשְׁכָּנוֹת לַאֲבִיר יַעֲקֹב:ו הִנֵּה שְׁמַעֲנוּהָ בְאֶפְרָתָה מְצָאנוּהָ בִּשְׂדֵי יָעַר:ז נָבוֹאָה לְמִשְׁכְּנוֹתָיו נִשְׁתַּחֲוֶה לַהֲדֹם רַגְלָיו:ח קוּמָה יְהוָה לִמְנוּחָתֶךָ אַתָּה וַאֲרוֹן עֻזֶּךָ:ט כֹּהֲנֶיךָ יִלְבְּשׁוּ צֶדֶק וַחֲסִידֶיךָ יְרַנֵּנוּ:י בַּעֲבוּר דָּוִד עַבְדֶּךָ אַל תָּשֵׁב פְּנֵי מְשִׁיחֶךָ:יא נִשְׁבַּע יְהוָה לְדָוִד אֱמֶת לֹא יָשׁוּב מִמֶּנָּה מִפְּרִי בִטְנְךָ אָשִׁית לְכִסֵּא לָךְ:יב אִם יִשְׁמְרוּ בָנֶיךָ בְּרִיתִי וְעֵדֹתִי זוֹ אֲלַמְּדֵם גַּם בְּנֵיהֶם עֲדֵי עַד יֵשְׁבוּ לְכִסֵּא לָךְ:יג כִּי בָחַר יְהוָה בְּצִיּוֹן אִוָּהּ לְמוֹשָׁב לוֹ:יד זֹאת מְנוּחָתִי עֲדֵי עַד פֹּה אֵשֵׁב כִּי אִוִּתִיהָ:טו צֵידָהּ בָּרֵךְ אֲבָרֵךְ אֶבְיוֹנֶיהָ אַשְׂבִּיעַ לָחֶם:טז וְכֹהֲנֶיהָ אַלְבִּישׁ יֶשַׁע וַחֲסִידֶיהָ רַנֵּן יְרַנֵּנוּ:יז שָׁם אַצְמִיחַ קֶרֶן לְדָוִד עָרַכְתִּי נֵר לִמְשִׁיחִי:יח אוֹיְבָיו אַלְבִּישׁ בֹּשֶׁת וְעָלָיו יָצִיץ נִזְרוֹ: