Using a comand button to open an external software?

Solved/Closed
alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015 - Sep 17, 2015 at 05:30 AM
alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015 - Sep 22, 2015 at 04:41 AM
Hello.

I'm using Excel and I need do create a comand button to open an external software, e.g. I need do order that button to open "Profis Anchor from Hilti". I already tried to google this question but I only find informations about how to open documents, etc.

Does anyone know how can I do this?
I really need this, I appreciate any help that anyone could give me.

1 reply

Ambucias Posts 47359 Registration date Monday February 1, 2010 Status Moderator Last seen September 1, 2021 11,241
Sep 17, 2015 at 05:53 AM
Hello

Perhaps that this "How-to" will help you:

https://ccm.net/apps-sites/software/3649-adding-a-vba-command-button/
1
alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015
Sep 17, 2015 at 08:08 AM
I dont have a lot of pratice but I'm going to "study" that topic and try to adequate the code to what I need.

Thank you for your help.
0
Ambucias Posts 47359 Registration date Monday February 1, 2010 Status Moderator Last seen September 1, 2021 11,241 > alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015
Sep 17, 2015 at 04:25 PM
Good luck and let us know.
0
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 25
Sep 18, 2015 at 09:11 PM
Once you have created the button: Point it to this macro.

In this example it will open Notepad.
You will need to supply the full path of the program you want to open in the Path string. e..g "c:\myprogram\exec\Profis Anchor from Hilti.exe" or whatever the software is you are trying to open.


Sub OpenExternalProgram()
    Dim x As Variant
    Dim Path As String

    ' Set the Path variable equal to the path of your program's installation
    Path = "notepad"

    x = Shell(Path, vbNormalFocus)
End Sub
0
alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015 > RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016
Sep 21, 2015 at 05:32 AM
Hello, first of all thank you for your help and i'm sorry for only reply today.

I tried the code above and I've 2 doubts:
1) when you say I need to suply the full path are you saying that I need to put:
path="c:\myprogram\exec\Profis Anchor from Hilti.exe" e.g

2)and when I run the macro it stops when I say that x="shell(path, vbNomralFocus)

What can I am doing wrong?

Thanks for your help.
0
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 25 > alfa_eng Posts 10 Registration date Thursday September 17, 2015 Status Member Last seen September 30, 2015
Sep 21, 2015 at 10:42 AM
1. Yes. You need to enter the folder location and the executable of the program you are trying to open. As another example for you:
C:\Program Files\Microsoft Office\Office14\WINDORD.EXE
Setting the path with the above value will point to Word (on my PC, yours may be different)
I don't know where the software you are trying to open is installed or what the executable is called so I cannot give you the exact value.
2. This is most likely happening (a guess since you don't give an error) that the path setting is incorrect.
0