Solved

CryptoAPI in VBA 7

Posted on 2012-04-09
7
1,963 Views
Last Modified: 2012-04-12
I am trying to use CryptoAPI using VBA 7 in a Windows 7,  64 bit environment.  Will this ever work?  I am trying to use Cryptography for Visual Basics by Richard Bondi but this is not working.  I getting type mismatch on CryptImportKey function for the Pointer to the CSP handler.

What would be the best way to implement Encryption/Decryption in this environment?
0
Comment
Question by:kkhan7
  • 4
  • 2
7 Comments
 
LVL 21
ID: 37825081
Her is what i use:  Encryption
0
 
LVL 12

Accepted Solution

by:
danishani earned 500 total points
ID: 37826347
0
 

Author Comment

by:kkhan7
ID: 37832635
Daniel,  

Thanks for your reply.  However, I had tried the code from the jdk site and I am using the correct PtrSafe datatypes and I am still receiving errors.  The VB code will work in using VBA in a Windows 7, 64-bit environment?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 21
ID: 37833950
Are you using he Access 2010 64-bit?  

I run Access 2003/2007/2010 32-bit versions on 64-bit windows OS's without having to use PtrSafe datatypes. AFAIK, you only need to use PtrSafe datatypes in VBA with Office 2010 64-bit apps.

The link I provided work fine on XP 64-bit/Vista 64-bit/Win 7 64-bit with Access 2003/2007/2010 32-bit.
0
 

Author Comment

by:kkhan7
ID: 37835108
Daniel,

Yes, I am using MS Access 64-bit, VBA 7 on Windows 7, 64-bit environment.  I get errors on CreateImportKey function when trying to import a private key.

Signed,
KKhan7
0
 

Author Comment

by:kkhan7
ID: 37839293
Daniel,

Thanks for your help.  I have switched to using Visual Studio 2010 to create a .NET class that I can call from VBA.

http://support.microsoft.com/kb/317535

Article ID: 317535 - Last Review: March 29, 2007 - Revision: 8.5

HOW TO: Call a Visual Basic .NET Class Library from Visual Basic for Applications in Microsoft Office


Signed,
KKhan7
0
 

Author Closing Comment

by:kkhan7
ID: 37839303
This solution had lots of information it just didn't work for my situation.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Cybersecurity has become the buzzword of recent years and years to come. The inventions of cloud infrastructure and the Internet of Things has made us question our online safety. Let us explore how cloud- enabled cybersecurity can help us with our b…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now