Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2015, 10:05 AM
ptmuldoon ptmuldoon is offline More OLE Link Issues Windows 7 64bit More OLE Link Issues Office 2013
Advanced Beginner
More OLE Link Issues
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default More OLE Link Issues

I'm going crazy over this Stuff !!

Ok. I have a macro that typically replaces the FilePath and FileName of each OLE Excel table and chart in my word file. Now, I fear I've uncovered an annoying bug when saving in the new .docx file format vs the older .doc file format. And hoping someone can confirm and possibly offer a solution.

In testing. I have a Word 2013 file saved as a .docx file with 2 links. One is linked to and using a Named Range, and the other is linked to cell range. When you first copy that to Word, the Link Field code look as follows:
Code:
{LINK Excel.SheetMacroEnabled.12 "C:\\Data\\Sample\\Sample.xlsm" "Cover Charts!Charts_Cover_Main" \a \p}

{LINK Excel.SheetMacroEnabled.12 "C:\\Data\\Sample\\Sample.xlsm" "Cover Charts!R28C10:R34C14" \a \p
Now after you save the file and then reopen it, that Link code is being slightly modified as follows.

Code:
{LINK Excel.SheetMacroEnabled.12 "C:\\Data\\Sample\\Sample.xlsm!Cover Charts!Charts_Cover_Main" "" \a \p}

{LINK Excel.SheetMacroEnabled.12 "C:\\Data\\Sample\\Sample.xlsm!Cover Charts!R28C10:R34C14" "" \a \p}
If you look carefully, you can see when Word first opens, the OLE code is being modified to include an exclamation point after the file name and before the cell/named range as well as pair of quotes at the end. But if you update links, it changes back to the way it should be.

The Problem.... When you first open the Word document, that modification of the Word file 'breaks' the ability to read the file name. when I open the word document, and run the following;

Code:
Sub SourceFileName()
Dim s As Variant

For Each s In ActiveDocument.InlineShapes
 MsgBox s.LinkFormat.SourceName
Next s
End Sub
Using the above, the SourceName returns inaccurately giving the following



For the NamedRange, it gives the filename plus the named range of
Code:
Sample.xlsm!Cover Charts!Charts_Cover_Main
and when using a cell reference, it returns only the cell reference and not even the file name of
Code:
R34C14
Can anyone confirm this behavior and have thoughts on returning just the file name when you first open a document and read the OLE link information?

Thanks
PT
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
More OLE Link Issues OneNote Online "Sorry, OneNote Online can't open this link" (Link to a Page within a Section Group) ross5 OneNote 2 02-09-2015 06:16 PM
Trying to link page numbers in the footer, but refuses to link after new section fl0shizzle Word 7 05-06-2014 12:15 PM
How to link an object to a URL link to update automatically expert4knowledge Excel 1 06-11-2012 09:30 AM
Excel to Powerpoint Link issues Weather PowerPoint 0 02-01-2011 02:02 PM
Issues with synchronization log causing send/receive issues WinSock64 Outlook 0 01-11-2011 11:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft