![]() |
#8
|
|||
|
|||
![]()
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 |
|
![]() |
||||
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 |
![]() |
BoringDavid | Word VBA | 5 | 05-09-2014 09:08 AM |
![]() |
SuzeG | Word VBA | 4 | 12-17-2013 03:40 PM |
![]() |
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 |