Avatar of brothertruffle880
brothertruffle880
Flag for United States of America asked on

Invoking an application using VBA

Hi I'm just trying to understand/learn VBA here:


The code in line 1 is working, the code in line 2 isn't.   Can anyone tell me why?

err
Microsoft ExcelVB Script

Avatar of undefined
Last Comment
Jorge Paulino

8/22/2022 - Mon
mvdeveloper

Not sure, but it might be compatibility issue if certblst.exe is a 64 bit app. Office by default installs a 32 bit VBA and so uses the 32 bit shell.

Try it using cscript (the console scripting applet): there are two versions, one under system and one under syswow64. Try each and see if there is a difference.

To run with cscript, just store your VBA in a text file with a .vbs extension and invoke:
(path_to)\cscript.exe your_file.vbs
ASKER CERTIFIED SOLUTION
LazyFolk

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jorge Paulino

You don't need to use scripting for that ... you can use Shell method instead.

Example:

Shell "C:\Program Files\Microsoft Office\Office14\excel.exe"

But you can use GetShortPathName() API to get the short name of a specific path. Check this example: http://www.vbusers.com/code/codeget.asp?ThreadID=633&PostID=1
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes