Error with application.ontime method in excel vba -


i havew live data feed in excel, want record data shown here:

enter image description here]

i wrote on code follows

option explicit  dim schedrecalc date sub recalc()     range("a1").value = format(now, "dd-mmm-yy")     range("b1").value = format(time, "hh:mm:ss am/pm")      call settime end sub  sub settime()     schedrecalc = + timevalue("00:00:01")     application.ontime schedrecalc, "recalc"     application.ontime schedrecalc, "record"  end sub  sub record() ' ' update macro '       worksheets("sheet1")          application.screenupdating = false         sheet1.range("a1:a169").copy _         destination:=mysheet.range("e9")         sheet1.range("e9:e169").insert shift:=xlshifttoright          selection.insert shift:=xltoright         application.cutcopymode = false      end  end sub   sub disable()     on error resume next     application.ontime earliesttime:=schedrecalc, procedure:="recalc",                     schedule:=false     application.ontime earliesttime:=schedrecalc, procedure:="record",         schedule:=false  end sub 

but following error coming.. have disabled security setting:

enter image description here]

i ran code. make sure procedure reference using application.ontime placed module.

you may double check last line. copying , pasting code didn't make vba editor happy.

sub disable()     on error resume next     application.ontime earliesttime:=schedrecalc, procedure:="recalc",                     schedule:=false     application.ontime earliesttime:=schedrecalc, procedure:="record",         schedule:=false end sub 

it should on 1 line.

sub disable()     on error resume next     application.ontime earliesttime:=schedrecalc, procedure:="recalc", schedule:=false     application.ontime earliesttime:=schedrecalc, procedure:="record", schedule:=false end sub 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -