Help needed - Strange hyperlink problem
"Dennis" wrote in message
47...
I have a strange issue with creating hyperlinks on desktops but not on
lap tops.
We received some new laptops at work that run on Windows 7 OS and
Microsoft Office 2007. We also had some desktops that were UPGRADED
from
Windoxs XP to Windows 7 and Microsoft Office 2007.
The issue is that when I create a hyperlink on the desktop and I use
the
browse to drill down to the network folder where the file is kept, it
takes (no jokes) 2 to 3 minutes to open the folder directory. Since
the
folder containing the files I need to hyperlink to is a few folders
deep
it takes over 10 minutes to create a hyperlink. The problem is with
hyperlinks only. If I browse on File/Open... there is no delay
drilling
down to the folder I need to get to.
If I create the hyperlink on the laptop, there is no delay in opening
the
folders directories (2 - 3 seconds per folders).
My IT group is working on resolving the issue but in the meantime I am
trying to create a macro that would open the folder where the files
are
kept without browsing and be able to select the file I want to link
to.
I used the macro recorder to create a hyperlink but I am forced to
select
a specific file (macro would always put a hyperlink to the same file),
I
can't figure out how to be able to select a different file every time.
I'd appreciate any anyone could give me.
Dennis
So you have some macro code that includes a line that looks something
like this:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv", _
TextToDisplay:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv"
You have several options - if you want the macro to pop a dialog box so
the user can type in a filename you could try:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
InputBox("Enter filename to link to"), _
TextToDisplay:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv"
If you want the filename to be in a cell in the active worksheet you
could use the currently selected cell like this:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
ActiveCell, _
TextToDisplay:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv"
Or you could point to a specific cell like this:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
ActiveSheet.Range("A1"), _
TextToDisplay:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv"
or using a named range like this:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
ActiveSheet.Range("NameOfNamedRange"), _
TextToDisplay:= _
"C:\Documents and Settings\Cliff\My Documents\Daily
Activity.csv"
HTH!
--
Clif McIrvin
(clare reads his mail with moe, nomail feeds the bit bucket :-)
|