I am trying to introduce a delay timer (10s) before calling a subroutine that will scroll my data by 1 column each loop. However, when I run the subroutine, the timer is ignored and the columns are scrolled without delay. Finally I get the following error for each instance (56) that loop is executed.
"Cannot run the macro "D:\SWFreezeStatus.xlsm'!ScrollData', The macro may not be available in this workbook or all macros may be disabled.
I've confirmed macro settings in Excel are set to "Enable all macros" and "Trus access to the VBA projet object model is checked.
Thank in advance for any help.
"Cannot run the macro "D:\SWFreezeStatus.xlsm'!ScrollData', The macro may not be available in this workbook or all macros may be disabled.
I've confirmed macro settings in Excel are set to "Enable all macros" and "Trus access to the VBA projet object model is checked.
Code:
'Sub HighlightCells()
'Highlight cells in spreadsheet based on criteria
'End Sub
'Scroll data to view all columns
Sub ScrollData()
Dim B As Integer
Dim WBNcount2 As Integer
WBNcount2 = Cells(3, Columns.Count).End(xlToLeft).Column
For B = 1 To WBNcount2
ActiveWindow.ScrollColumn = B + 1
Call ScrollTimer
Next
End Sub
'Set timer to wait 10s before each call to ScrollData()
Sub ScrollTimer()
Dim gCount As Date
gCount = Now + TimeValue("00:00:10")
Application.OnTime gCount, "ScrollData"
End Sub
Thank in advance for any help.