?
Solved

CryptoAPI in VBA 7

Posted on 2012-04-09
7
Medium Priority
?
2,183 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
Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

 
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

649 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