Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  

News      User Comments     History     Notify Me

11/25/2014 7:58:29 AM
New Access Tip: Shell Function
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

In this Microsoft Access tip I'm going to show you how to use the SHELL function to open external programs (like Word, Excel, Acrobat, etc.) and load up files (documents, sheets, PDFs, etc.) to display.


I cover this topic in a lot more depth in my new Microsoft Access Open Other Programs Seminar.

Permanent Link
Keywords: access tips
Post Reply

New Access Tip Shell Function Comment from Marc S @ 12/17/2014
BINGO that was is it not the full path. Thank you, seasons greetings.

Reply from Alex Hedley:

Glad you got it working :)
Show Just This Thread        Post Reply
New Access Tip Shell Function Comment from Marc S @ 12/16/2014
When I try shell function with acroRD32.exe I keep getting "Microsoft Visual Basic-Run-time error 53-File not found" error.  I can get shell to work with notepad.exe but not with adobe. Sounds like a missing dll according to a quick internet search but which one.
Any ideas or leads on fixing this error ?
Otherwise this shell thing would be great if it worked for me.
Thank you

Reply from Alex Hedley:

Are you quoting the full path of where Adobe is? If there are spaces it can have trouble.
Show Just This Thread        Post Reply
New Access Tip Shell Function Comment from Marc S @ 12/4/2014
I have two related questions.

1. Is there a way to tell the external program to open to a specified page in the document. (I would like Adobe to open a pdf to page x)

2. Is there a way to send an external file (pdf) directly to the printer AND  have the number of copies match a number field from access ? (for example print 28 copies of this worksheet with 28 being the number of students in a class)

Good stuff Richard.

Reply from Richard Rost:

1. It depends on the program. Adobe Acrobat WILL accept a command-line parameter for the page number following the /A switch. I believe it's something like


That should open MyFile.PDF to page 7. See this document for details.

2. You can send direct to the default printer very easily. Just use the NORMAL option instead of the PREVIEW option when opening a report. The number of copies could be controlled with a FOR NEXT loop in your button's VBA code. So the answer to your question is "yes, with a little programming."

Show Just This Thread        Post Reply

Add Your Comments or Subscribe
If you just want to subscribe to get email updates when the News is updated, then enter your name and email address and check the Notify Me box below. If you would optionally like to add your comments below to be posted, they are welcome.
  Your Name:  Required
  Your Email:  NOT Public


Sorry about this step. It's just to keep the spam bots away:
  Verify: What is 4+6:
  Notify me when the News is updated.
  Remember Me for my next comments
Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be.
As always, I promise to never give away your personal information to anyone else, ever.

NOTE: If you don't leave your name and email address, DON'T expect a reply. I can't promise a personal reply to everyone who posts here. I TRY my best, but I cannot guarantee it. If you don't leave your real name and email address, I won't even bother. I usually just hit DELETE. -Richard



You may want to read these articles from the 599CD News:

3/30/2020Access DateDiff Function
3/26/2020Sorted Combo Box Values
3/23/2020Browsing and Selecting Files
3/14/2020New Access Group
3/6/2020NEW Access 2019 for Beginners
8/15/2019Last Chance for Access CDs
8/1/2019Customer List Form Template
8/1/2019New Template Access Customer Database
7/30/2019Microsoft Access Developer 13
6/20/2019TIP: Validation Rules in Access

Visual Basicindex
Account Login
Online Theater
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Live Chat
Customer Support
WalkThru Tutorials
Consulting Services
About Us
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Gift CDs
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP