Excel 2007 =Hyperlink issue. Calling an EXE with a / switch. The "/" turns into a "\"

1

1

I'm trying to run a program from a spreadsheet using the =HYPERLINK function. The formula looks like this (I'm using DIR just as an example so people can recreate the issue if they want):

=HYPERLINK(c:\dir /w","dir test")

When placed in a cell this gives me a hypertext link named "dir test" that does not run when clicked on. When you hover over the example, the forward slash "/" looks to be interpreted properly, but the ensuing "Microsoft Office Excel Security Notice" shows the "/" being interpreted as "\" (forward slash gets changed to a back slash) and when you run it you get the message "Cannot open the specified file".

The forward slash seems to be a reserved character. Anyone know how to escape it?

I've tried

=HYPERLINK("c:\dir "&CHAR(47)"w ",dir test)

=HYPERLINK("c:\dir "&"//"&"w",dir test)

But they all have the same issue.. Any ideas? I can run the command fine without the / argument, but I need it for my purposes..

I've read the related answers but none of them mention the behaviour of the forward slash turning onto a backslash. In the end as someone pointed out, it may not be possible to pass any arguments this way...

user1854377

Posted 2015-03-23T19:55:05.353

Reputation: 11

Possibly related to Pass command line arguments from Excel hyperlink .

– OSol1tair3 – 2015-03-23T20:28:20.960

possible duplicate of Excel (2010) HYPERLINK: how to call a file with command line arguments and spaces in the path?

– DavidPostill – 2015-03-23T20:31:02.187

Can you pass any argument(s) to the program (such as a plain word, a filename, or an option that begins with a dash)? The linked (related/duplicate) questions suggest that it's impossible to pass any arguments, in which case you are barking up an unimportant tree (the error message is incorrect). – Scott – 2015-03-23T21:11:54.700

I think Scott has the right of it, I'm barking up the wrong tree, the security message is a false one and no switches like that are going to work. I'll have to go the VBA route. – user1854377 – 2015-03-24T13:02:04.470

No answers