krijnsent / crypto_vba

An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
MIT License
155 stars 54 forks source link

Cannot get privateapi functions to run #6

Closed zylozylo closed 6 years ago

zylozylo commented 6 years ago

Hi, thanks for building this!

I am having trouble getting any of the Private API functions to work. Specifically, excel crashes whenever I call any of the CreateObject("System.Security.Cryptography.SHA256Managed") lines of modHash. I get this error:

Run-time error '-2146232576 (80131700)': Automation error

Any ideas what I need to do to get it working? I've added mscorlib.dll as a reference (it's v4.0.30319) If it makes any difference, I'm using Office Pro 2016, and I'm running Windows 10

Zylo

krijnsent commented 6 years ago

Hi Zylo, it seems a more general windows/office problem. If I search for it I find an "update a VB.NET network drive" solution, but am not sure whether that will be your solution: https://social.msdn.microsoft.com/Forums/en-US/9bfcd001-5168-4cff-b2ba-6b8e8d465138/excel-2010-vb-runtime-error-2146232576-80131700-automation-error-on?forum=exceldev

And as an alternative workaround: https://stackoverflow.com/questions/42533731/system-security-cryptography-sha256managed-in-net-4-5-windows-10

Hope that one of those things work for you! Koen

zylozylo commented 6 years ago

Thankyou! :) Your Sub TestHash now runs without problems after I followed the first link's solution and downloaded and installed the Microsoft .NET Framework 2.0 Service Pack 2