View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Hyperlink in cell to path/file name

The following formula will return the complete file name (Drive, Path,
File) of the file in which it appear.

=SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","")

Leave "filename" as is. Don't change it to some actual file name. The
file must have been saved to disc at least once for this to work.

This result is just a string, which can be imported to an Access
column. I don't know the details of what Access does with a field
whose type is Hyperlink. What exactly does "don't [work] in Access"
actually mean?

Once you have the file name string, you might want to go down the hall
to the Access newsgroups for more info on what Access does with
columns declared as Hyperlink.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sun, 12 Apr 2009 11:12:01 -0700, MikeF
wrote:


Need to put a hyperlink in a cell, say ax2, with the current drive
letter\path\filename and nothing else.

The hyperlink will be imported into an Access table, and needs to be what
will get me back to this Excel file.

Have tried lots of INFO and CELL formulas, they all *look* like they work,
but don't in Access.
The only thing that works is manually copying the path from the locator bar,
and that is, well, no fun!

Regards,
- Mike