How can I insert a link on command button (or another way) to start another application from Excel?
Using some kind of Hyperlink or....
What other ways are to call another applications from Excel and start as a new application?
Private Sub cmdCommandButton1_Click()
On Error Resume Next
Set wrdApp = GetObject("Word.Application")
If Err.Number <> 0 Then Set wrdApp = CreateObject("Word.Application")
On Error GoTo 0
wrdApp.Visible = True
and this will start WCalculator:
AppFile = "Calc.exe"
On Error Resume Next
If Err <> 0 Then
Err = 0
CalcTaskID = Shell(AppFile, 1)
If Err <> 0 Then MsgBox ("Can't start Calculator")
But probably forget SAP, you will not get the rights from your db administrator to access directly the normalized tables. SAP is a system that works strictly with transaction and they probably won't let you to remote-control this process via VBA. I tried for a long time and I had to give up in the end.
Been here, done that (with SAP). My application opened emails and transfered data to SAP. If you are expecting a faultless operation don't start, you will not get it. The final result was relatively unreliable because things (like opening menus or changing dialog view) take some time to happen on screen. Despite putting Waits in the code there were still crashes at times when the server was extra slow. Despite all this, the user was happier with it than without.
I was unable to use Shell to open SAP because the method was controlled by our IT department, as well as requiring passwords, so opened manually and went from there. The principle is to 'fool' SAP into accepting Virtual Key commands from the macro rather than the keyboard. Sendkeys, for some reason, was unreliable so had to use API calls to mimic keyboard action which is basically 2 events - keydown and keyup. So you have to do things like tab to a textbox, select the data there, and Ctrl+C to copy - all with the keyboard.
I am happy to email you with a copy of my code as is, but not to spend a lot of time explaining or supporting it. It is pretty well commented. This is far from a trivial undertaking, especially as it is not possible to debug code by stepping through line by line - because in this case the VB Editor becomes the active window and Virtual Key strokes are applied there. If you do want the code, just send me a PM with your email address.