Set windows 10 date from VBA

YasserKhalil
PlatinumLounger
Posts: 4931
Joined: 31 Aug 2016, 09:02

Set windows 10 date from VBA

Post by YasserKhalil »

Hello everyone

I have searched a lot for that topic and didn't find an answer
How can I set the time for the Windows 10 system?
I tried this but I got permission denied

Code: Select all

Sub ChangeDate()
    Date = DateSerial(2020, 5, 5)
End Sub
How can I set the date without privileges?

User avatar
StuartR
Administrator
Posts: 12629
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Set windows 10 date from VBA

Post by StuartR »

YasserKhalil wrote:How can I set the date without privileges?
You cannot set the date or time on a Windows system without privileges
StuartR


YasserKhalil
PlatinumLounger
Posts: 4931
Joined: 31 Aug 2016, 09:02

Re: Set windows 10 date from VBA

Post by YasserKhalil »

Thanks a lot for reply Stuart