By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,646 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,646 IT Pros & Developers. It's quick & easy.

Word Document not running VB Code......

P: 6
Hey everyone I have 3 ComboBox's on a form on a Word Document that is being used as a drop down menu to select certain items. In order to input each item in the ComboBox's I put this code in:
Expand|Select|Wrap|Line Numbers
  1. Private Sub UserForm_Initialize()
  2.  
  3.   ComboBox1.ColumnCount = 1
  4.  
  5.   'Load data into ComboBox
  6.  
  7.   ComboBox1.List() = Array(" ", "Content Room A", "Content Room B", "Content Room C", "Content Rooms AB", "Content Rooms BC", "Content Rooms ABC")
  8.  
  9.   ComboBox2.ColumnCount = 1
  10.  
  11.   'Load data into ComboBox
  12.  
  13.   ComboBox2.List() = Array(" ", "Conference", "Classroom", "Lecture", "Horseshoe")
  14.  
  15.    ComboBox3.ColumnCount = 1
  16.  
  17.   'Load data into ComboBox
  18.  
  19.     ComboBox3.List() = Array(" ", "CORP", "ESPN3", "DISNEY")
  20.  
  21. End Sub

The problem I am having is that when I close the document and open it back up or send it to someone else, it is not automatically running the code so the ComboBox's appear as empty.

Any thoughts on this?

Thanks,
-Joe
Dec 21 '07 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

The problem I am having is that when I close the document and open it back up or send it to someone else, it is not automatically running the code so the ComboBox's appear as empty.
-Joe
Are you Saving the document before Closing...?

Regards
Veena
Dec 22 '07 #2

P: 6
Hi,



Are you Saving the document before Closing...?

Regards
Veena

Yeah, I save it and it doesn't keep it. I have to go into VB and highlight the coding, click the run button and then it'll work.
Dec 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.