I have a hyperlink vbscript that displays a message using msgbox. I am receiving permission denied trying to use msgbox on 10.3.1 clients.
The script still works fine on 10.0 clients.
Anyone know a fix for this problem?
guessing wildly that vb wasn't installed... it used to be, but it is being slowly nudged out
Introduction to installing and configuring ArcGIS for Desktop—Help | ArcGIS for Desktop
The script executes fine when the message box line is excluded. The hyperlink is also vbscript and not VB or VBA. MsgBox works when executed from a .vbs file outside of ArcMap.
well, then I am sure you have been through these, but it appears to be a difference between the versions that isn't obvious
Using Hyperlinks—Help | ArcGIS for Desktop
perhaps showing the lines would help
The message box call will cause the script to fail. Even the simplest of scripts fail.
Function OpenLink ( [FACILITY_ID] )
The rest of the script does not matter. Adding MsgBox anywhere causes the error when you click verify and the link does nothing when used.
So if those lines fail by themselves ... forgetting the rest of the script ... then I find it strange. If it the mere fact that the msgbox was open causing the rest of the script to fail, then that is something I have no clue about.
I ran into a similar problem when writing scripts for the web using vbscript ... apparently in my case the code was server side code which was not valid.... I had to re-write the section for "Client Side"
This server side code fails with Permission denied and continued processing just stops similar to what you are describing
Had to re-write to client side:
<Body onload= x()>
However I don't know if this still applies this was back in the ASP days "Active Server Pages"
I found the ASP/webservice related forum posts on Google, but I did not see how I could relate to the ArcMap hyperlink option.
As always there are ways around it but you would have to create your own hyperlink launcher as an object and you would have to use the createobject command on your custom launcher to employ msgbox.
Better explanation can be found here:
Advanced Hyperlink Functionality
I ended up converting the script to python and using the ctypes library to create the popup. Sadly, 10.0 doesn't have a python option for hyperlinks, so now I have 2 scripts and lyr files to support, one for 10.0 and one for 10.3.
This is the python code for open a folder and displaying a message if it doesnt exist:
def OpenLink ( [Foldername] ):
path = '\\\\server\\sharename\\'+[Foldername]
subprocess.call('explorer "'+path+'"', shell=True)
ctypes.windll.user32.MessageBoxW(0,u'Folder was not found:\n'+path,u'Not Found',0)
Sucks that they killed MsgBox functionality sometime after 10.0 though.
Similarto using the field calculator you can only verify the script, however if you have problems the error codes most of the time has no relation to what is wrong with the code. Having some sort of debugging or even a msgbox could help in tracking down problems.....
Retrieving data ...