Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

How to run a program from inside VBA in Powerpoint 2003

I'm not able to run an external program from inside a VBA program (in PowerPoint 2003). The command "shell" doesn't work (I used it successfully in Excel 2003!). The error message says that t's an invalid function call. Any suggestion?
0
blos
Asked:
blos
1 Solution
 
andreyman3d2kCommented:
Is the information here helpful? Seems like another command can be used according to this...

http://www.suodenjoki.dk/us/productions/articles/vbashellexecute.htm
0
 
JSRWilsonCommented:
Shell DOES work in PowerPoint

What code are you using

eg

Dim RetVall As Double
RetVal = Shell("pathtofile")
0
 
blosAuthor Commented:
The not working line is:
    Dim lngHWnd As Double
lngHWnd = Shell("X:\Documenti\My Data\VB\Albero genealogico.exe", vbNormalFocus)
The file "X:\Documenti\My Data\VB\Albero genealogico.exe" exists and can be run without troubles.
In the object visualization I can see: Librery:VBA, Class: Interaction, Member: Shell, but the above line doesn't work
0
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.

 
trungk43Commented:
Please try this link. It works fine for PP 2003

http://support.microsoft.com/kb/q129796/
0
 
blosAuthor Commented:
Thanks trungk43
It works fine, and does exactly what I need!
0
 
blosAuthor Commented:
You have to PAY ATTENTION when initializing the cmdline$ string, because blanks are interpreted as command line parameter separators! So if your executable file name has blanks inside it, it must be enclosed between inverted commas; by example, if the name of the program you have to run is MY PROGRAM.EXE,
the following line is right:
cmdline$="""MY PROGRAM.EXE"""
because the resulting string is delimited by inverted commas, while the following line is wrong:
cmdline$="MY PROGRAM.EXE"
because it's interpreted as "run the program MY with the parameter PROGRAM.EXE"
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now