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

How to create a combobox with my DB in Excel?

P: 3
I am creating a new software with visual studio 2010 using the program language visual basic .NET, well in that software I create a new file in excel 2007, my question is because I do not know how I can create a combobox with data of my database inside, I will be appreciate your help a lot, thank for your time.
To create the combobox I use the next code in a button of my windows form, It actually is an adaptation of the code shared by sammyB (
Expand|Select|Wrap|Line Numbers
  1.     Dim xlApp As Excel.Application
  2.         Dim xlBook As Excel.Workbook
  3.         Dim xlSheet As Excel.Worksheet
  4.         Dim xlcombobox As Excel.OLEObject
  5.         Dim iStartLine As Long
  7.         xlApp = New Excel.Application
  8.         xlApp.Visible = True
  9.         xlBook = xlApp.Workbooks.Add
  10.         xlSheet = xlBook.ActiveSheet
  13.         xlcombobox = xlSheet.OLEObjects.Add(ClassType:="Forms.combobox.1", _
  14.          Link:=False, DisplayAsIcon:=False, Left:=1, Top:=25, Width:=72, Height:=24)
  15.         xlcombobox.Name = "clientes"
I donít know how to continue help me please
Jun 18 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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