Object not created

bitmax

New Member
Joined
Sep 6, 2024
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
The object created for 'enc' is void of all variables. Seems to be an empty object. I have both 'mscorlib.dll' and 'System' checked off as references. I assume it is some sort of pathway problem but I have no idea on how to fix this.

Private Function HEX_HMACSHA1(ByVal sTextToHash As String, ByVal sSharedSecretKey As String) As String
'Dim Asc As Object
Dim enc As Object
Dim TextToHash() As Byte
Dim SharedSecretKey() As Byte
Dim bytes() As Byte
Dim sHexString As String
Dim i As Long

'Set Asc = CreateObject("System.Text.UTF8Encoding")
Set enc = CreateObject("System.Security.Cryptography.HMACSHA1")
TextToHash = HexStringToByteArray(sTextToHash)
SharedSecretKey = HexStringToByteArray(sSharedSecretKey)
enc.Key = SharedSecretKey

bytes = enc.ComputeHash_2((TextToHash))
HEX_HMACSHA1 = ByteArrayToHexStr(bytes)
'Set Asc = Nothing
Set enc = Nothing
End Function
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Thanks for the help Dermie_72. I reviewed the article and that didn't help.
It seems Set enc = CreateObject("System.Security.Cryptography.HMACSHA1") is creating an HMACSHA1 object but it doesn't have any variables. It just creates an empty object.
1725685499887.png
 
Upvote 0

Forum statistics

Threads
1,221,503
Messages
6,160,193
Members
451,630
Latest member
zxhathust

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top