Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-14-2015, 02:07 PM
ptmuldoon ptmuldoon is offline Create UserForm ComboBox or ContentControl Windows 7 64bit Create UserForm ComboBox or ContentControl Office 2013
Advanced Beginner
Create UserForm ComboBox or ContentControl
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

My word document is currently linking to 63 separate tables in Excel. All of those links are already in the document, and the user can simply press F9 or right click to update the table.

But there will be (and has happened already) times when the user mistakenly deletes the charts from table. And they do have the 'know how' on creating/adding the paste-link table back into the document.

So, the ContentControl should provide a listing of all of the available charts. And the user can then insert a chart back into the document. It does not have to be specifically within the content control.

I think may be better to have it added outside the content control actually in case the user needs to edit/change the link source?

I've created a listing in excel (attached), and I can add the link code in with this basic code for a single link. But creating a full listing is still beyond me.

Note, the 'links' in the excel file all used names ranges to where the actual tables are in the excel file.

Code:
'  Additional code above using late binding..
' 
Set objXL = CreateObject("Excel.Application")   'set reference to the Excel Object
    Set objWkb = objXL.Workbooks.Open(FileName:=prmFileName)  'set reference to the Excel workbook
    Set objSht = objWkb.Sheets(prmSheetName)  'set reference to the Excel Sheet
       
    With objSht
        ChartLink = .Range("C2")
        MsgBox ChartLink
    End With

    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:=ChartLink, PreserveFormatting:=False
Attached Files
File Type: xlsm TestFileLinks.xlsm (17.2 KB, 13 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
Create UserForm ComboBox or ContentControl Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
Create UserForm ComboBox or ContentControl Trying to Reference a ContentControl Using DocProperty SuzeG Word VBA 4 12-17-2013 03:40 PM
Create UserForm ComboBox or ContentControl Activate/ select ContentControl czsti Word VBA 1 08-14-2013 08:32 AM
ComboBox ListIndex = -1 even though it does NOT = -1 Joe Patrick Word VBA 0 08-03-2011 08:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:22 AM.


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