How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Suryanto Your Own Question

Suryanto
Suryanto, Programmer
Category: Microsoft Office
Satisfied Customers: 595
Experience:  Programmer, 9 years experience in VBA(Excel, Word, Outlook and Access) programming
48489642
Type Your Microsoft Office Question Here...
Suryanto is online now
A new question is answered every 9 seconds

Hi! Im trying to link an activex combobox in MS Word 2007

This answer was rated:

Hi! I'm trying to link an activex combobox in MS Word 2007 to a database in either Excel or Access with VBA. I just need someone to walk me through it, please.
Dear Customer,

Welcome to Justanswer.

Please let me know if you still need help

Thank you
Suryanto
Customer: replied 5 years ago.
Yes, I do, please.
Ok. Could you send me your file and explain your problem ?
Please go to www.wikisend.com and upload your file there.
Once you do that you get a page that has the File Id and Download Link.

Please
copy the fileid or download link and please paste here in your reply

graphic
Thank you
Customer: replied 5 years ago.
#1 = File ID: 166640 = http://wikisend.com/download/166640/ComboBox examples.doc

#2 = File ID: 448344 = http://wikisend.com/download/448344/ComboBox examples.xls

I have added activex combo boxes to file 1. Instead of inserting code in the actual document with what I want the lists to be, I'd like to have the boxes populate from lists loaded in file 2. That way I can link not only file 1 but multiple documents to the lists in file 2.

Hi,

Sorry for delay. I will check and let you know

Thank you
Hi,

This is the code
http://wikisend.com/download/262526/ComboBox examples2a.doc

Make you have enabled macro to run because you open the file

When you open the word file, the macro will automatically open combobox example.xls and fill the combobox with the data from column A and column B

Hope this helps

Please let me know if you have problem or please click ACCEPT so I am compensated for my time
Bonus and Feedback are highly appreciated

Thank you
Customer: replied 5 years ago.

Thank you so much! It works in the example word doc I sent you but when I transfer the code to one of the actual documents I'll be using I get a runtime error 13 type mismatch.

 

Here is the real doc: File ID 566718

 

Do you know why it wouldn't work on this and can you make it work?

Hi,


This is the Word file
http://wikisend.com/download/443620/ADA_Request_Form1a.doc

This is the excel file. Put in the same folder with the word file
http://wikisend.com/download/263778/combobox entry.xls

The last code will assign object only if the control name is XXXXX XXXXX Combobox2


Hope this helps

Please let me know if you have problem or please click ACCEPT so I am compensated for my time ( I get nothing for my efforts until customer click Accept )
Bonus and Feedback are highly appreciated


Thank you
Suryanto

Customer: replied 5 years ago.
I will absolutely accept your answer and will definitely pay you extra but I need to make sure it works in reality, not just an example document (I have no idea why it would be different). As soon as it is working properly I will accept. Thank you!
Hi,

This is the Word file
http://wikisend.com/download/443620/ADA_Request_Form1a.doc

This is the excel file. Put in the same folder with the word file
http://wikisend.com/download/263778/combobox entry.xls

The last code will assign object only if the control name is XXXXX XXXXX Combobox2


Hope this helps
Suryanto and other Microsoft Office Specialists are ready to help you
In the example file, all controls are combobox.
Dim cbo As msforms.ComboBox
Set cbo = ish.OLEFormat.Object
The command won't generate error because all controls are combobox.

In the latest file, you have comboboxes, textboxes and command buttons . So the command Set cbo = ish.OLEFormat.Object will generate error because in variable declaration, cbo is MSForms.Combobox

I modified the last code to assign object only if the control name is XXXXX XXXXX Combobox2

Hope this helps

Thank you