Hello,
I am getting subject-mentioned error on execution of both
I hope there would be some method like referencing some .Net FW dll files so that this code could run without .Net FW 3.5.
I am getting subject-mentioned error on execution of both
Set sysText = CreateObject(SYS_TEXT_UTF8)
and With CreateObject(SHA512_MANAGED)
. This error is resolved when I install .Net FW 3.5 however there are few PCs with my users on which we are unable to install .Net FW 3.5 as those PCs came with Windows 10 pre-unstalled and didn't receive install CD with them. To install .Net FW 3.5, we need to use DISM
command with install CD inside DVD ROM.I hope there would be some method like referencing some .Net FW dll files so that this code could run without .Net FW 3.5.
Code:
Const SYS_TEXT_UTF8 As String = "System.Text.UTF8Encoding", _
SHA512_MANAGED As String = "System.Security.Cryptography.SHA512Managed"
Dim sysText As Object, _
arrBytes As Variant
Set sysText = CreateObject(SYS_TEXT_UTF8)
With CreateObject(SHA512_MANAGED)
arrBytes = .ComputeHash_2(sysText.GetBytes_4(strToHash))
End With