Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display the contents of Excel on an Access form

Status
Not open for further replies.

jender624

Programmer
Jul 1, 2003
50
US
Anybody know a way to display the contents of an excel spreadsheet on an access form? I've been putzing around with an excel activeX control, but I can't figure out how to actually load a file into it programmatically.

Here's my app concept: I've got a guy that came to me and asked if I could come up with a way to dynamically search an excel ss through an access program. I want to provide search criteria (which column, what it starts with, ends with, etc...), and then display the results on the form.

Any input would be helpful.
 
Try something like this:
Dim objXL As New Excel.Application
Dim objWB As Excel.Workbook
Set objWB = objXL.Workbooks.Open("\path\to\ss.xls")
objXL.Visible = True


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
This looks like something I might be able to use. Thanks so much for the fresh idea!
 
I think the solution to my problem lies in creating a table linked to an excel spreadsheet, and then displaying the contents of the table (or query with the table included) in a subform on the main form. The only problem is, I'm having some difficulty creating the linked table through VBA. The user can choose an excel file through a dialog box, and based on his/her choice I want the subform to update and show the contents of the excel file via the linked table I spoke about.

Does anybody have any examples that would show how to properly link an access table to an excel file through code?

Thanks!

jender624
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top