i haven't tried the code out yet so i have no clue if it will work or not, but the "CreateObject("WScript.She
if anyone else has any ideas in case this doesn't work, it would be nice to know about them as well.
Main Topics
Browse All Topicshey guys,
I'm trying to access the registry from VBA. I need to have my program find the path of a Acrobat. The location is in HKEY_CURRENT_USER\Software
So what I want to do is have my VBA program get that key and save it so that I can have VBA open acrobat. I looked around the MSDN site and it looks like I have to declare a function to call the windows API. I'm unsure how to get this key exactly. Right now i have:
Private Declare Function RegQueryInfoKey Lib "Registry" (ByVal strHKEY As String)
End Function
First off, I have no clue if that lib is right, and secondly, i know that i have to have more than just the HKEY location, I need to have the paths. I also was reading that i have to have the key opened first b/c of security reasons, etc. So that looks like it will require me to make another call to the windows API to get access privileges. Any help you guys can give as to how to accomplish this would greatly be apprecaite. thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i haven't tried the code out yet so i have no clue if it will work or not, but the "CreateObject("WScript.She
if anyone else has any ideas in case this doesn't work, it would be nice to know about them as well.
Business Accounts
Answer for Membership
by: wes_wilsonPosted on 2002-11-25 at 09:53:33ID: 7494999
I have this code that I use through WSH to get the MDAC version of the computer I'm working with, you should be able to adjust it for your use. There really isn't a need to use API calls unless you are trying to work with remote machines with VBA/VBS doesn't support. Note this is VBS code, not VBA but they are pretty much the same, you may have to tweak this a bit.
l") CVer.Versi on\CLSID\" ) ID\" & MDACClsid & "\Version\")
l") tware\Adob e\Acrobat Reader\5.0\InstallPath")
Dim MDACClsid
Dim WshShell
On Error Resume Next
Set WshShell = CreateObject("WScript.Shel
MDACClsid = WshShell.RegRead("HKCR\MDA
If Err.Number <> 0 Then
MDACVersion = "Not installed"
Else
MDACVersion = WshShell.RegRead("HKCR\CLS
End If
wscript.echo "Version: " & mdacversion
I believe your code would look like:
Dim strInstallPath
Dim WshShell
On Error Resume Next
Set WshShell = CreateObject("WScript.Shel
strInstallPath = WshShell.RegRead("HKCU\Sof
If Err.Number <> 0 Then
strInstallPath = "Unable to Read Install Path"
End If
wscript.echo "Version: " & strInstallPath
Good Luck
-Wes