Trying to appactivate ERP window

Status
Not open for further replies.
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
I am trying to switch between outlook and my ERP system ( visual enterprise) but cannot get visual to activate.

I put path as" \\visualsql\apps\vmfg\VM.EXE" but it just open a login for administrator.

The module window that is open is estimating window VMESTWIN.EXE if I add that to path it opens same login.

Is there a way to activate the open window I have ?

this is what I am using: Which just open administrator login box.

Public vPID As Variant
Public Sub OpenApplication()
'Launch application if not already open
If vPID = 0 Then 'Application not already open
101:
vPID = Shell("\\visualsql\apps\vmfg\VMESTWIN.EXE", vbNormalFocus)
Else 'Application already open so reactivate
On Error GoTo 101
AppActivate (vPID)
End If
End Sub
 
Where are you assigning a value to vpid? As written, its always going to open a new window because vpid will always be 0.

This works to bring an open notepad file into focus:
Public Sub OpenApplication()
vPID = "notepad"
AppActivate (vPID)
End Sub



This might work for you - you should use the process friendly name. In the examples in the screenshot, you only need the program name - excel, chrome, teams, edge (but t works with the full name). Also, if the application is minimized, it takes focus (the button highlights) but will not open on screen.

Public Sub OpenApplication()
vPID = "VMESTWIN"
On Error GoTo 101

AppActivate (vPID)
j = 1
Debug.Print j
101:
If j = 0 Then
vPID = Shell("\\visualsql\apps\vmfg\VMESTWIN.EXE", vbNormalFocus)
End If
End Sub

process.png
 
Diane, Hi. thanks. I can get notepad to open - #1 below works.
and example #2 to open outlook works.

But if I put "VMESTWIN" into code I get run-time error '53' file not found. ?

#1 - works.
Public vPID As Variant
Public Sub OpenApplication()
'Launch application if not already open
If vPID = 0 Then 'Application not already open
101:
vPID = Shell("NOTEPAD", vbNormalFocus)
Else 'Application already open so reactivate
On Error GoTo 101
AppActivate (vPID)
End If
End Sub
or

#2 - works
Public vPID As Variant
Public Sub OpenApplication()
'Launch application if not already open
If vPID = 0 Then 'Application not already open
101:
vPID = Shell("OUTLOOK ", vbNormalFocus)
Else 'Application already open so reactivate
On Error GoTo 101
AppActivate (vPID)
End If
End Sub

#3 - DOES not work. ??????
Public vPID As Variant
Public Sub OpenApplication()
'Launch application if not already open
If vPID = 0 Then 'Application not already open
101:
vPID = Shell("vmestwin", vbNormalFocus)
Else 'Application already open so reactivate
On Error GoTo 101
AppActivate (vPID)
End If
End Sub

VMESTWIN.PNG
 
Diane,

I tried following but get run-time error '53" file not found.

Public Sub OpenApplication()
vPID = "VISUAL"
On Error GoTo 101
AppActivate (vPID)
j = 1
Debug.Print j
101:
If j = 0 Then
vPID = Shell("\\visualsql\apps\vmfg\VISUAL", vbNormalFocus)
End If
End Sub

general tab.PNG
 
this: vPID = Shell("\\visualsql\apps\vmfg\VISUAL
i think you may need to use the full path to the exe if not found and just visual (or whatever is showing as the process name in task manager) for the if running version.
 
Diane,

below is opening sysadm login for vmestwin.exe from server location " \\visualsql\apps\vmfg\VMESTWIN.EXE"
See below visual properties screen shot.

what is active is starting from U:/VISUAL.... which is where INI files for user are located.

maybe I am missing something from my path, my full path is not correct.

any other ideas ?



Public Sub OpenApplication()
vPID = "VISUAL"
On Error GoTo 101
AppActivate (vPID)
j = 1
Debug.Print j
101:
If j = 0 Then
vPID = Shell("\\visualsql\apps\vmfg\VMESTWIN.EXE", vbNormalFocus)
End If
End Sub

TEST 3.PNG
 
You might try using Explorer to do it for you... using the file path (strFilePath)

VBA.Shell "Explorer.exe " & Chr(34) & strFilePath & Chr(34), vbNormalFocus ' Use Windows Explorer to launch the file.
 
Mark,
Thanks ! I am new to VB... do you have a complete example that I can look at for ref. ?

Kurt
 
Sadly no... just dim the variable strFilePath, then in yr code say where it is strFilePath = ".....\...\...exe" and then on the next line use the code I sent before... so
dim strFilePath as string
strFilePath = "C:\Users\" & Environ("username") & "\Documents\BlarBlarBar.exe"
VBA.Shell "Explorer.exe " & Chr(34) & strFilePath & Chr(34), vbNormalFocus
 
Ooops... you're using VB my code is VBA... Sorry- prolly worth a try though
 
Diane,

below is opening sysadm login for vmestwin.exe from server location " \\visualsql\apps\vmfg\VMESTWIN.EXE"
See below visual properties screen shot.

what is active is starting from U:/VISUAL.... which is where INI files for user are located.

maybe I am missing something from my path, my full path is not correct.

u:/visual is the startin directory - this is the path to the actual \\visualsql\apps\vmfg\VMESTWIN.EXE exe. I think you'd want to use the path to the exe, at least if its not already running.
 
Ooops... you're using VB my code is VBA... Sorry- prolly worth a try though
the shell sample you posted will work VBA. Not sure it will work for kurtis's problem...
 
Diane,

thinking here now it has something to do with password. if I open estwin from within visual it activates. ( no problem)

if I try to appactive using vmestwin.exe it opens a login.

is there anything you know I can incorportate that" username" something like Mark Whites example. ?
 
try Shell "runas /user:domain\username" "c:\program files\internet explorer\iexplore", vbNormalFocus - you'll need to enter the password - I'm not aware of anyway to pass the password to the dialog.
 
Diane,

thanks you!!

Ok. I got this. Thanks for the help. after .exe I had to specify database, username, and password.
If visual is not open. if visual estimating window is open just appactivate "estimating".

Working example below:

Public vPID As Variant
Public Sub OpenApplication()
'Launch application if not already open
If vPID = 0 Then 'Application not already open
101:
vPID = Shell("\\visualsql\apps\vmfg\VMESTWIN.EXE -DVMFG -UKAS -PKAS", vbNormalFocus)
Else 'Application already open so reactivate
On Error GoTo 101
AppActivate ("ESTIMATING")
End If
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
e_a_g_l_e_p_i I can't believe what I am seeing when trying to install Outlook 2021 Using Outlook 9
C Trying to move messages between imap accounts/folders Using Outlook 5
J Outlook 2016 Trying to get Outlook 2016 to work with Office 365 Using Outlook 0
U Outlook not responding when trying to print Emails Using Outlook 6
e_a_g_l_e_p_i Trying to customize the ribbon but can't figure this one out Using Outlook 3
B Outlook 2016 Outlook crashes when trying to print certain emails Using Outlook 5
M outlook 365 trying to finish my sentences Using Outlook 2
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
R Error when trying to forward current email item Outlook VBA and Custom Forms 7
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
O The page that you are trying to access cannot be loaded. Using Outlook 0
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
T Outlook "A program is trying to access Outlook" Using Outlook 3
S SendFromAccount - Problem trying to test existing value in open email Outlook VBA and Custom Forms 2
N Error 0x80090326 when trying to setup IMAP account on Outlook.com Using Outlook.com accounts in Outlook 1
R Trying to extract information between two symbols from outlook subject Using Outlook 2
Danie Lawson Trying to recover calendar Using Outlook 4
L Trying to open contacts pst. file in outlook 365 Using Outlook 3
L Trying to check for the absence of mail. Outlook VBA and Custom Forms 1
M trying to disable junk email filter. completely. Using Outlook 4
D Trying to repair Outlook rules Using Outlook 5
S Outlook 2010 trying to default Data file to outlook.com calendar Using Outlook 6
C Trying to move my Business Contact Manager ver. 2003 to BCM ver. 2010 Using Outlook 3
R Trying to sync my Outlook email on iphone Using Outlook 1
A outlook trying to keep sending Using Outlook 1
P Trying to add subject and name to an email using VB Code Using Outlook 3
B Trying to get old emails from a not working computer but having trouble. Using Outlook 6
P Outlook works, but freezes when trying to use calender v2007 (vista prof) Using Outlook 1
K A program is trying to send an e-mail message on your behalf... Using Outlook 1
P Trying to get 'Calendar Name' to appear like 'Subject' and 'Location' in event Using Outlook 0
S Trying to have a prompt to ask for text to be added to subject before sending. Using Outlook 3
A Trying to connect to exchange Exchange Server Administration 3
K Wont send or recieve now with new server keeps asking for password when trying Using Outlook 1
D Outlook "Trying to Connect" Exchange Server Administration 1
P Word experienced and error trying to open the file Using Outlook 2
S Trying to install BCM 2010 x64, getting error BCM (Business Contact Manager) 8
D Outlook 2003 - A program is trying to access e-mail addresses Outlook VBA and Custom Forms 5
S Trying to create a UPS from Outlook VBA and Custom Forms 2
T Trying to start Outlook from VBA or VBS not working. Outlook VBA and Custom Forms 4
S how to disable security message in save attachments macro "A programis trying to access e-mail addre Outlook VBA and Custom Forms 5
A Error: 3033 when trying to OpenDatabase using DAO Outlook VBA and Custom Forms 3
U Recovered PST file "Cannot move item" error when trying to move e- Using Outlook 6
D Error trying to connect to database on the server BCM (Business Contact Manager) 1
D Trying to reconnect BCM databases in Outlook 2003 BCM (Business Contact Manager) 1

Similar threads

Back
Top