remove the Application on time from the knappen Function and maybe use this format cause its shorter and easier to read
Sub knappen()
Dim WS As Worksheet
Set WS = ThisWorkbook.Sheets("MLC")
WS.Range("CADNOK").FormulaR1C1 = "=StockQuote(""CADNOK=x"")"
WS.Range("USDNO").FormulaR1C1 = "=StockQuote(""USDNOK=x"")"
WS.Range("SEKNOK").FormulaR1C1 = "=StockQuote(""SEKNOK=x"")"
WS.Range("Axactor").FormulaR1C1 = "=StockQuote(""axa.ol"")"
WS.Range("Bakkafrost").FormulaR1C1 = "=StockQuote(""bakka.ol"")"
WS.Range("DNO").FormulaR1C1 = "=StockQuote(""dno.ol"")"
WS.Range("Golden").FormulaR1C1 = "=StockQuote(""gogl.ol"")"
WS.Range("GoldenReg").FormulaR1C1 = "=StockQuote(""gogl-r.ol"")"
WS.Range("Kinross").FormulaR1C1 = "=StockQuote(""k.to"")"
WS.Range("Nel").FormulaR1C1 = "=StockQuote(""nel.ol"")"
End Sub
Then put this in ThisWorkbook
Like this it restarts the Timer only if iths saturday or sunday and does also start knappen on the other days
Private Sub Workbook_Open()
Call startTickerShedule
End Sub
Sub startTickerShedule()
If Weekday(Now, vbMonday) < 6 Then
Application.OnTime VBA.TimeValue("23:59:00"), "knappen"
Application.OnTime VBA.TimeValue("23:59:59"), "startTickerShedule"
Else
Application.OnTime VBA.TimeValue("23:59:00"), "startTickerShedule"
End If
End Sub
Bookmarks