Advertisement

04.23.2008 at 11:36AM PDT, ID: 23347779
[x]
Attachment Details

Changing Link/Hyperlink filenames in Excel VBA

Asked by thomasedooley in Microsoft Excel Spreadsheet Software, Miscellaneous Programming

Tags: Microsoft, Excel, XP (2002)

We're changing file servers in a couple of weeks, so our share names are going to change. We'll be keeping the logical name (J:), but will be changing from something like:
\\filesrv1\ABC$
to:
\\filesrv2\ABC$

Subsequently, I have to help people sort out their links in Excel (and other Office apps), and update those to the new file server name.

I ran a test, and using the same drive letter assigned to the new share does not do the trick - I get an error "Cannot start the source application for this object" for Links, and "The Address of this site is not valid. Check the address and try again." for hyperlinks.

I've done some research, and the Excel VBA .LinkSources Method only reveals the drive letter. I need a method that will allow me to address (and change) the full file path (\\filesrv1\abc$\...).

Using the .SourceName Method on an OLEObject also only reveals a string of the sort:
"MSPhotoEd.3|J:\pictest\testpicture.JPG!"'

On the Hyperlink side, the .Hyperlinks method only exposes "../../../abc$/pictest/testpic.jpg". This is a problem...

I know that PPT has methods (for Links and Hyperlinks) that will expose the fully qualifed filename, so I'm able to cover that application. I need that same functionality in Excel, or we're in BIG trouble with our users when we make the cutover.

Any ideas?
thanks in advance for any help you can provide...Start Free Trial
[+][-]04.24.2008 at 03:07PM PDT, ID: 21435613

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 10:25AM PDT, ID: 21472788

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 10:41AM PDT, ID: 21472940

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 01:34PM PDT, ID: 21474331

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Miscellaneous Programming
Tags: Microsoft, Excel, XP (2002)
Sign Up Now!
Solution Provided By: zorvek
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.30.2008 at 05:46PM PDT, ID: 21475727

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 05:51PM PDT, ID: 21475750

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628