?
Solved

CryptoAPI in VBA 7

Posted on 2012-04-09
7
Medium Priority
?
2,119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 21
ID: 37825081
Her is what i use:  Encryption
0
 
LVL 12

Accepted Solution

by:
danishani earned 1500 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

752 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