Using a comand button to open an external software?

Solved/Closed
alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015 - 17 Sep 2015 à 05:30
alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015 - 22 Sep 2015 à 04:41
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.
Related:

1 response

Ambucias Posts 47312 Registration date Monday 1 February 2010 Status Moderator Last seen 28 March 2026 11,166
17 Sep 2015 à 05:53
Hello

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

https://ccm.net/apps-sites/software/3649-adding-a-vba-command-button/
alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015
17 Sep 2015 à 08:08
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.
Ambucias Posts 47312 Registration date Monday 1 February 2010 Status Moderator Last seen 28 March 2026 11,166 > alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015
17 Sep 2015 à 16:25
Good luck and let us know.
RayH Posts 122 Registration date Tuesday 31 August 2010 Status Contributor Last seen 20 June 2016 26
18 Sep 2015 à 21:11
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
alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015 > RayH Posts 122 Registration date Tuesday 31 August 2010 Status Contributor Last seen 20 June 2016
21 Sep 2015 à 05:32
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.
RayH Posts 122 Registration date Tuesday 31 August 2010 Status Contributor Last seen 20 June 2016 26 > alfa_eng Posts 5 Registration date Thursday 17 September 2015 Status Member Last seen 30 September 2015
21 Sep 2015 à 10:42
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.