简体   繁体   中英

vba get weekday name from file created date?

I am trying to get the weekday name from a files created date:

Wk = WeekdayName(objFile.DateCreated)

So for instance, if my file has a file created date of 16/12/2016, then this will give a result of:

Friday

Please can someone show me where i am going wrong?

format(dateserial(2016,12,25),"DDDD") 

Weekdayname relies on a weekday input, not a date. so you could get that and use Weekdayname something like this

WeekdayName(Weekday(dateserial(2016,12,25),vbMonday))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM