Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-26-2011, 07:54 AM
Joe Patrick Joe Patrick is offline load list box from range in excel Windows 7 64bit load list box from range in excel Office 2007
Advanced Beginner
load list box from range in excel
 
Join Date: May 2011
Posts: 33
Joe Patrick is on a distinguished road
Default thank you, macropod!

Thank you so much!

Unfortunately, I can't get the rest of it to work either. I suppose it may be outdated but a couple of things don't seem right to me.

-I changed 'listbox1' to 'combobox1' since that's what i'm using
-If i'm not supposed to be referring to DAO when in Excel 2007 then is this correct?
-I get runtime error 3170 - 'could not find installable ISAM

Private Sub UserForm_Initialize()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim NoOfRecords As Long

Set db = OpenDatabase("U:\TPCentral_Too\PE_GC_list.xls", False, False, "Excel 12.0")
Set rs = db.OpenRecordset("SELECT * FROM 'PEdatabase'")

With rs
.MoveLast
NoOfRecords = .RecordCount
.MoveFirst
End With

ComboBox1.ColumnCount = rs.Fields.Count
ComboBox1.Column = rs.GetRows(NoOfRecords)

rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
load list box from range in excel list of Opened excel files SDondeti Word VBA 10 05-10-2018 03:52 PM
Excel - move with tab through named range mjlaw Excel 4 03-26-2012 10:40 AM
Searchable list in excel? leahca Excel 7 11-24-2011 04:44 AM
PowerPoint Add-in fails to load in start up but loads successfully if load manually f shahbazlibra PowerPoint 0 11-30-2010 08:36 AM
Through VBA, export range from Excel to Word duugg Word VBA 0 08-24-2009 07:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft