Hello,
Does anyone know how to fix this error pop-up window that says:
"Cannot run the macro "https ://d.docs.live.net/. etc./filelocation/filename'macrosname'. The macro may not be available in this workbook or all macros may be disabled "
Even with macros settings enabled fully, in excel 365 , the macros only runs once and then stops. It is supposed to keep printing row by row every 30 seconds but only does this once then the error pops up.
The macros is embedded in the same worksheet and references cells from the same worksheet. here is the code.
Does anyone know how to fix this error pop-up window that says:
"Cannot run the macro "https ://d.docs.live.net/. etc./filelocation/filename'macrosname'. The macro may not be available in this workbook or all macros may be disabled "
Even with macros settings enabled fully, in excel 365 , the macros only runs once and then stops. It is supposed to keep printing row by row every 30 seconds but only does this once then the error pops up.
The macros is embedded in the same worksheet and references cells from the same worksheet. here is the code.
VBA Code:
Sub SavePrice()
Dim WS As Worksheet, NextRow As Long
Set WS = ThisWorkbook.Worksheets(1)
WS.Cells(1, 1).RefreshLinkedDataType
DoEvents
WS.Cells(2, 1).Value = Now
NextRow = WS.Cells(Rows.Count, 1).End(xlUp).Row + 1
WS.Cells(NextRow, 1).Resize(1, 4).Value = Array(WS.Cells(2, 1).Value, WS.Cells(2, 2).Value, WS.Cells(2, 3).Value, WS.Cells(2, 4).Value)
WS.Cells(NextRow, 5) = Cells(NextRow, 3) - Cells(NextRow, 4)
If WS.Cells(1, 9).Value = True Then
Exit Sub
Else
Kind Regards,
KC
Application.OnTime Now + TimeValue("00:00:30"), "SavePrice"
End If
End Sub