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
Post a Comment