Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Run shell command in VBA

Posted on 2008-11-19
3
Medium Priority
?
2,248 Views
Last Modified: 2012-05-05
I have tested the below code running from a macro in excel and it works fine
Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen \\path"

But instead of opening fax viewer i want to open document imaging. I tried this but it doesn't work. I know document imaging is mspview.exe but don't know if thats what i need.
Shell "rundll32.exe C:\Program Files\Common Files\Microsoft Shared\MSPaper\MSPVIEW.EXE, \\path"

Also instead of path I want the value of the active cell in excel, which is the path.

Any help would be appreciated as I have tried loads of variations
0
Comment
Question by:j8547
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
AmazingTech earned 500 total points
ID: 22995067
Try this.

Shell "C:\Program Files\Common Files\Microsoft Shared\MSPaper\MSPVIEW.EXE"
0
 

Author Comment

by:j8547
ID: 23002520
Yes that works. I have tried that path before but I was putting the run infront of it and then nothing was happening. It opens up document imaging. How do I pass the value of the active cell. it is a path to a file
0
 

Author Comment

by:j8547
ID: 23002554
Got all working. Thanks for your help.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 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