Aerocom
asked on
VB 6 error 5 in windows 10 but not in XP
In an app I have a function that shells to an other executable that checks for available updates. the code used is
Private Sub CmdUpdateprog_Click()
Dim progupdate As String
progupdate = App.path & "\pacsupdate.exe"
Shell progupdate, vbNormalFocus
End Sub
This works fine in XP which the app was developed in but throws up the warning
Runtime Error 5 invalid proceedure call or argument in some windows 7 and windows 10 PC's
Running the sheel app directly on a windows 10 PC throws up a user account control warning and the app will run normally after permitting it to run
Anybody got a solution
Private Sub CmdUpdateprog_Click()
Dim progupdate As String
progupdate = App.path & "\pacsupdate.exe"
Shell progupdate, vbNormalFocus
End Sub
This works fine in XP which the app was developed in but throws up the warning
Runtime Error 5 invalid proceedure call or argument in some windows 7 and windows 10 PC's
Running the sheel app directly on a windows 10 PC throws up a user account control warning and the app will run normally after permitting it to run
Anybody got a solution
This is UAC blocking you
ASKER
What do you mean by UAC?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you That fixed it.
I knew there was a access problem with non Admin users but did not expect it when logged on as Admin. I have now put in a message box instructing users to use the right click/admin open.
I knew there was a access problem with non Admin users but did not expect it when logged on as Admin. I have now put in a message box instructing users to use the right click/admin open.
ASKER
Sorted quickly
You may also want to create a link to your program and in advanced properties select always run as Administrator
ASKER
When users install the program it places a link icon on their desktop. As it is only some users that have the problem and often users cannot change setting themselves because of IT restrictions, I have opted for an error trap with a message box that tells them to run as admin when the error 5 occurs.
Users that have no problems will not see the message.
Users that have no problems will not see the message.