#1
|
|||
|
|||
Word Template with OLE Links Issues
I am creating a template in Word 2007 that has a number of OLE links to various charts in excel. But I am always being prompted to Save the Template after a creating a new file from that template.
This is with creating a NEW document based on the template. And not opening the template itself. I am also even prompted to save the template file even when saving just the docx file itself when that is the only file open. If I removed the OLE links, I can create a new document and then save without any prompts to save the template, and things seem to work fine. The only info I found on the web is about including a macro in the template to save the template on close here. But I could not get that to work either. http://answers.microsoft.com/en-us/o...0-fc8a2c0d9015 If anyone has any suggestions. I open to trying anything. |
#2
|
|||
|
|||
Doing as much reading as I can as well.
All I do is just open the template, and I see the Saved property in VBA changes to False. It may be better to move the topic over to the Word VBA area, as thay may be the only way to stop the prompts. But I've added the below macro in trying to troubleshoot, and still not working Code:
Sub Test() 'Dim Doc As Document 'For Each Doc In Documents ' MsgBox Doc.AttachedTemplate.Name & vbTab & Doc.AttachedTemplate.Saved 'Next Dim Tmplt As Template For Each Tmplt In Templates MsgBox Tmplt.Name & vbTab & Tmplt.Saved Next End Sub Private Sub Document_Open() Dim Tmplt As Template For Each Tmplt In Templates ActiveDocument.AttachedTemplate.Saved = True Next ' MsgBox "Greetings" End Sub |
#3
|
|||
|
|||
I'm still working on finding the cause, but from what I can tell Word is modifying the LINK code when Word first opens.
I have done nothing then to simply open the Word Template file. And in testing, I see the link code is getting changed as follows The File opens as the follow link Code:
{ LINK Excel.Sheet.8 "C:\\Data\\Template\\Blank Workpapers.xlsm!Cover Charts!Charts_Cover_Main" "" \p } Code:
{ LINK Excel.Sheet.8 "C:\\Data\\Template\\Blank Workpapers.xlsm" "Cover Charts!Charts_Cover_Main" \p } And Whats strange is the initial paste special link shows is what the second one listed. So Word is first changing the link on open, and then changing back to what it was originally pasted linked as? |
#4
|
|||
|
|||
SUCCESS!!
I want to post back for anyone else that comes across this similar problem. Again I still don't know why Word will automatically modify the LINK field upon opening. My 'guess' is that when you create an OLE link from Excel (and maybe other programs) is that Word is "establishing" the link, and your chart, etc will show in Word. And you can toggle F9 to see the chart or LINK reference. The solution.... And you need to do this for every OLE link in your document. First, create all of the OLE links like normal. Paste Special Link. Next, Insert a LINK field in word directly beneath each of the charts/OLE links. In Word 2007, this under Insert | Quick Parts | Field. For Office 2007, Choose Link Excel Sheet 8 This will give you the following: Error! No topic specified. Toggle F9 and you can see it just a link reference and does not includes any file path info. Now, you need to manually copy and paste the file path info and cell/name reference of each link into the new LINK reference. And then delete the original copy paste special OLE link. You should still see the Error! No topic specified even after adding the file path info. Again, I do not why this is the case. The two LINK references will look identical when your done. Yet one will show as Error! No topic specified, and the other will show the actual chart. When your all done, the MSWord template should function like normal. You can create a new document from the template and should NOT be prompted to save your template. You can then change and update all the links in your document as normal. One Warning..... Do NOT open the template directly and update the links. That will create the link/bond to your excel file and you'll have to redo it all. Last edited by ptmuldoon; 11-23-2014 at 09:32 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Links need to be Hot links in Bibliography in Word 2010, 2013 | synses | Word | 1 | 11-23-2013 12:48 AM |
Automatic update of links in template - closing attached template without saving | stefaan | Word | 2 | 11-02-2013 07:46 AM |
PPT-Template Language Issues | nunezc | PowerPoint | 0 | 04-18-2012 01:18 PM |
Outlook 2010 Email Template issues | texanaggie | Outlook | 0 | 02-01-2012 05:41 AM |
Word - Links point to template rather than new document | mconigol | Word | 1 | 04-01-2011 03:29 PM |