Can I run an .exe from VBA?

R

Rob Hughes

I am trying to create a fully automated application which will be printing
data from Access to a .pdf. We are currently using PdfFactory Pro, which
unfortunately requires the changing of registry entries to modify things
like the filename and location that it will save in. As it looks like I
can't interact with those entries via VBA, I was thinking that I could call
a little VB program that did the manipulations. However, I can't find any
documentation on calling external programs from within VBA. Is this even
possible?

Thanks
 
H

Howard Kaikow

u can execute the program using Shell. and you can modify the registry via
the API.
 
J

Jonathan West

Rob Hughes said:
I am trying to create a fully automated application which will be printing
data from Access to a .pdf. We are currently using PdfFactory Pro, which
unfortunately requires the changing of registry entries to modify things
like the filename and location that it will save in. As it looks like I
can't interact with those entries via VBA, I was thinking that I could
call
a little VB program that did the manipulations. However, I can't find any
documentation on calling external programs from within VBA. Is this even
possible?

Hi Rob

You can make Windows API calls from VBA, and modify any part of the registry
using suitable API calls. (As it happens, the native calls from VB6 are
identical to their their VBA equivalents)

Karl Peterson has created a code sample that does all you need in this area.
Go to the following page

http://vb.mvps.org/samples/project.asp?id=RegSettings

and download the file there. You can drop the CRegSettings.cls file straight
into your VBA project and it should work unmodified.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top