workaround for problem hyperlinks in Excel (doesn't work if pathcontains # character)

M

mad.scientist.jr

In Excel I am running into an issue when trying to create a hyperlink.
If the path contains the # character, Excel returns an error "Cannot
open the specified file" and does not open the folder. It seems the #
sign is the problem - paths with space, dash or single quotes work
fine:

WORKS: C:\temp\my path test
ERROR: C:\temp\my #path# test
WORKS: C:\temp\my -path- test
WORKS: C:\temp\my 'path' test

Here is a workaround for the problem. Instead, link to a vbscript that
opens the folder:

=HYPERLINK("File:///C:\temp\mypath1.vbs","my #path# test")

where the mypath1.vbs file contains:

Option Explicit
Dim Shell, wsh
Set wsh = WScript.CreateObject ("WScript.Shell")
Set Shell = WScript.CreateObject ("Shell.Application")
Shell.Open "C:\temp\my #path# test"
WScript.Quit()

The only pain is that when you click the hyperlink, Windows asks
"would you like to open this file?" and you have to click Yes.

If anyone has any other suggestions let me know.

---------------------------------


Dave Peterson
View profile
More options Jan 7 2006, 2:25 pm
Newsgroups: microsoft.public.excel.misc
From: Dave Peterson <[email protected]>
Date: Sat, 07 Jan 2006 13:25:56 -0600
Local: Sat, Jan 7 2006 2:25 pm
Subject: Re: hyperlink navigation path path wrong in Excel 2003
Reply to author | Forward | Print | Individual message | Show original
| Report this message | Find messages by this author
I don't have a guess about the HTM saving and reopening, but you can
use:

=hyperlink("File:////c:/mypicts/mypict.jpg","Click me")

Did you select the cell and Insert|hyperlink and verify the address?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top