View Single Post
 
Old 07-10-2016, 10:46 PM
celias celias is offline Windows 10 Office 2016
Novice
 
Join Date: Jul 2016
Posts: 5
celias is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
I you are asking about:

Code:
Debug.Print Selection.Range.ContentControls(1).ID
'or
MsgBox Selection.Range.ContentControls(1).ID
You can run either from the VB Immediate window.
Hi, @gmaxey,
I was asking about the very first code on this thread (I'm sorry if I didn't place my question correctly).

I have a word template file with just one dropdown list created. I named the dropdown list as "Clients" and it has no options entered yet. I wanted to fill it with a list of clients that I have on column A of Sheet1 on an Excel file called "Clients List".

I created a macro on Word called Dropdownlist and I pasted the suggested code there. I changed the location for the StrWkBkNm file.

When I run the macro I get the error message: "Run-time error '1004': Application-defined or object-defined error". The file does exist and column A of sheet1 has data from A1 down to A106...

Do you have a suggestion about how to fix this?
Would this have to do with something called "declarations" that I saw somewhere?

Thank you in advance for any tip.

Last edited by celias; 07-10-2016 at 11:12 PM. Reason: forgot to say something
Reply With Quote