excel - Use Application.Wait immediately after a workbook opens -


i need workbook display color after open it. after 5 seconds color change. implemented following code:

private sub workbook_open()     application.activesheet.cells.interior.colorindex = 4         application.wait (now + timevalue("0:00:05"))     application.activesheet.cells.interior.colorindex = 5 end sub 

however when click on file, loads 5 seconds , opens , displays second color. how fix while still using application.wait.

i tested , worked.

use in workbook_open

private sub workbook_open()     'schedules procedure run @ specified time in future     '(either @ specific time of day or after specific amount of time has passed).     application.ontime + timevalue("00:00:01"), "dothis" end sub 

put in module. not thiswork or won't work

private sub dothis()     application.activesheet.cells.interior.colorindex = 4     application.wait (now + timevalue("0:00:05"))     application.activesheet.cells.interior.colorindex = 5 end sub 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -