Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working on an Excel-document to make a (project-)folder structure manageable, using HYPERLINKs to important files and folders (Word/Excel, etc.).

Since we are also using TFS, I want to add the possibility to check out and check in right from within the Excel sheet. The one-stop landing and overview page.

If I simply have

=HYPERLINK("C:\work\TF.exe";"simple test")

I get a security warning, but the program executes.

In the end, I want something like

=HYPERLINK("C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\TF.exe status $/MyProject/Documents /recursive";"Find local Check Outs in Document folder")

However, this does not work for spaces in the file path and also for the command line arguments. Is there any way to make this run without using VB? Even if I wrap parts of the hyperlink with quotes (using double double quotes for Excel: "" -> ") does not improve anything, I get "file not found" error.

And.. only only only if I have to use VB (I do not like the security warning), what would be the best way to do this?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

An alternative is to create a shortcut with the relevant commandline switches embedded in it. Then you can hyperlink to the shortcut. Note that the shortcut has a .lnk extension.

share|improve this answer
    
+1 - nice and easy too :) –  Jook Oct 25 '12 at 15:50
4  
Or do the same with a batch file (.bat), which should be more versatile than a shortcut. –  Bob Oct 25 '12 at 15:55
    
It does not allow me to use parameters (e. g. a cell with the path), still, it is working fine, just a little overhead right now, and I might go for the VB solution later. Many thanks! –  Andreas Reiff Oct 26 '12 at 15:39

As far as I know, it is not possible to use HYPERLINK like that - except with the nice trick of anthony.

However, spaces in the hyperlink don't matter as long as the path is in quotes.

To solve this you might have to use VBA, if the command-line parameters have to be dynamic or if you don't want to use anthonys approch for other reasons.

This would be a neat fast way:

Shell "C:\Program Files (x86)\Notepad++\notepad++.exe -notabbar", vbMaximizedFocus

or to use your code:

public sub demo()
  Shell "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\TF.exe status $/MyProject/Documents /recursive"
end sub

By the way - usually there is, and should be, a warning, when executing files through hyperlinks. So if you wan't to use HYPERLINK because of "don't like warnings", you got them there too ;)

On the other hand - the VBA solution can avoid warnings, if you sign your Workbook with a trusted signature or use it in a folder, wich is setup as trusted for macros.

share|improve this answer
    
Thanks, I might go to this eventually in order to only have the path in one cell, and then have the other cells simply refer this and call different files with parameters. –  Andreas Reiff Oct 26 '12 at 15:40

Your Answer

 
discard

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.