I have a button on a window that uses system.net.openURL to open an excel file on a network share. The path is something like ‘\\SharedSystem\LAB\Rotation 2013.xls’ The lab manager updates that file on a regular basis and the other users open it from inside an ignition project. When we upgraded to Excel 2010, the file extention changed to .xlsx. When I put the new file path in the openURL, nothing happens when the user clicks the button. There is no error generated, but the file does not open either. If I save the file as 97-2003 Excel workbook with an extention of .xls, then it opens just fine. We are using vision module 6.5.3.
It should work as long as a machine that is running the client has Excel 2010 installed.
It does. I get the same resultes running it from my PC and it has 2010 Office running on it.
The client is running Windows, right? I’m guessing based off your Vision version that you’re using Ignition 7.5.3, is that correct? Is this exactly what your script looks like?
Yep. That is correct and the correct version.
Here is the code in the button:
system.net.openURL(’\\Bigfoot\sys\USERS\LAB\Schedule 2013\Rotation 2013.xlsx’)
If I change it to open the .xls file it works just fine with this code:
system.net.openURL(’\\Bigfoot\sys\USERS\LAB\Schedule 2013\Rotation 2013.xls’)
Curious: If you paste those URLs into your web browser do they open in excel?
Yes. They both open Excel when pasted into the browser once I remove the extra backslashes.
Did you use the same browser that gets opened when you system.net.openURL() to an actual web address?
Yes. I acutally only have IE 9 on my PC.
I have had a few other people trying opening the file from the project and it is working on their PCs. I suspect that it is something on the different PCs that first ran into this issue. I will make sure all the windows updates are current and see if there is something specific with these PCs that is causing the issue. Anyway, it is not an ignition issue as I originally thought. Sorry about the wild goose chase.
No problem, try and update the thread when you figure it out. It might help someone else with the same problem in the future.
I am not sure exactly what fixed it. The PC in the lab that had the issue originally, had automatically downloaded MS updates, but had not finished the install of them. I rebooted the PC to complete the install and it worked fine afterwards. My PC did not have any updates pending, but I restarted it anyway and it worked the next time I loaded the project.
I am not sure what was causing the issue, but I know it was not a typo as I had both lines of code in the button and just switched the comment from one to the other while testing. Sorry I can not point to anything more specific than some weird Microsoft issue.
Still glad to hear that you got it sorted out and working.
I know this thread is 4 years old but figured might be better not to open a new one.
I’m using office 2013 and Ignition 7.9.5. I’m trying to open a xlsx file on the shared drive. originally I kept getting error path is wrong but eventually got it working but I have one Issue, I have no issue getting a file to open on the client PC drive or the main folder of the shared drive, but if I use the actual path then nothing happens, the path is something like:
I can use single ‘’ just fine if the folder name doesn’t start with a number because then I get some error and in the error in the path instead of the starting numbers there is a weird black dot so I changed it to
But nothing happens when I click the button.
I even tested this on a file that was on the MainFolder and it opened it up just fine, same with a file on my own desktop but for some reason it has an issue with that path… anyone dealt with this issue?
Are you using backslashes in a string constant in your code? If so, you have to double them up, as backslashes are used as an escape for special characters in most languages. Including python. Choosing backslashes as a folder separator is an ancient Microsoft screw-up.
I dont know what happened when I was typing my messages but what I meant to say was I changed it to
P:\MainFolder\\2.1 Folder\\ 1.1Folder\Folder\file.xlsx
P:\\MainFolder\\2.1 Folder\\ 1.1Folder\\Folder\\file.xlsx
I understand the double backslash method now my question is how comes one backslash worked when I tried opening a file in
That really confused me
Ok update, I think I know what this is happening. The file is locked by someone else I assume that’s why the file is not being opened. It would have been nice if It attempted to open it and would show the box saying it is locked by someone else.
Anyways, I guess this issue is resolved now…