Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to add hotlink to QGIS? I saw this but had some problem. I want to open network location like \\fileserver\filefolder\file1.excel but it ends with error.

Edit: The network location is stored in a column of the table eg. URL column contains URL value for each attribute. Different row has different URL.

share|improve this question
It would help if you could describe the error. – sgrieve Sep 7 '12 at 7:44
@sgrieve Unable to run command. I actually have stored the location in one of the column and I have used it has an expression. – kinkajou Sep 7 '12 at 8:19
Maybe you need to prefix it with file:// or local://, since it is not directly on one of your disks. I imagine dos batch commands will have trouble interpreting that though. – lynxlynxlynx Sep 7 '12 at 8:30
@lynxlynxlynx still same error :( – kinkajou Sep 7 '12 at 8:41
On what OS are you using QGIS? – Giovanni Manghi Sep 7 '12 at 8:46
up vote 7 down vote accepted

This way it works for me on Windows and Qgis 1.8.0:

Create a point shapefile with a field url of type string. Add a point and fill the url field with


without any blanks or quotation marks unless you have blanks in folder and filenames. Don't forget to save the layer, end leave edit mode.

In the layers properties, create a new action of type Generic , name it open and add

cmd /c [% "url" %] 

as action.

Select the Action icon, move the mouse over the point and click to open the excel sheet. The Excel sheet should have the standard .xls extension.

share|improve this answer
tried it but my path has space i.e. my file name has space "test test12.xls" it opens a command window and nothing happens – kinkajou Sep 7 '12 at 12:00
It might work if you put the whole path inside quotes. Just guessing though. – Rayner Sep 7 '12 at 12:33
Just tested: "\\fileserver\filefolder\file 1.xls" (with the quotation marks!) in the shapefile field works. – AndreJ Sep 7 '12 at 12:35
Glad I could help. Please vote my comment up if you think it was useful. – Rayner Sep 7 '12 at 16:45
@Rayner its helpful but my url is one of the column of table – kinkajou Sep 9 '12 at 9:47

I'd use python. After reading a blog post from Tim Sutton at linfiniti [1] I learned you can use python in actions:

eg something along those lines:

from pywin32.client import Dispatch
xl = Dispatch('Excel.Application')
wb = xl.Workbooks.Open('C:\\Documents and Settings\\GradeBook.xls')

taken from another post [2]



share|improve this answer
I don't know if it is excel or pdf as I have mentioned in the question it can be pdf or any other file too. I use it with mapinfo currently. It's easy in Mapinfo but I am not able to find this feature in Qgis easy. – kinkajou Sep 10 '12 at 1:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.