![]() |
#1
|
|||
|
|||
![]()
I've been struggling with the best way for a user to be able to press a button/macro, etc then choose from a selection of charts to add to their document. I think I moved away from using building blocks to either a UserForm or Content Control.
In my Excel file, I have created a worksheet that has 2 columns. A Chart Name and the LINK code of the chart. From Macropod, I found this post on creating a Content Control how-import-list-excel-into-drop-down But for some reason, when I when chose an Item, I am not getting the Value to show in the word document although I see a different value (ie, column B) when viewing the properties. and then I also found this post by MVP Greg Maxey on setting up a Userform list from the excel data populate_userform_listbox_or_combobox. But again, I'm still struggling on getting the dropdown list to show a Chart Name/Description, and then input the link code. I can post more sample code. But before doing so. Which would be the better approach to work with. And to help, In word, I can currently open the excel file, get the link and add it with the below. Now I'm trying to create a listing of all of the charts/links Code:
' Code above to get Excel File and Chart. Using late Binding so user ' does not need to set reference in Word. ' ' With objSht ' ChartLink = .Range("C2") ' MsgBox ChartLink ' End With ' ' C2 Cell Value is = LINK Excel.SheetMacroEnabled.12 "C:\\Data\\SampleWPs.xlsm" "Cover Charts!Charts_Cover_Main" \p ' 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 |