Solved

VBA code to import excel table in Access

Posted on 2008-06-22
6
6,041 Views
Last Modified: 2013-11-27
Hi! For my Access database, I am looking for a VBA code that would:
- Open a windows dialog box and let the user select an excel file
- create an empty table called "Import"
- copy the content of the columns of the excel file into the column of the access "Import" table.
Blank cells do not need to be imported, only the filled ones.
Thanks!
0
Comment
Question by:gallandjc
  • 3
  • 2
6 Comments
 

Author Comment

by:gallandjc
Comment Utility
Sorry, to make it clear, the Access table must be a duplicate of the excel table ie have the same number of columns with the same data in the cells.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
try this sample db
selectExcel.mdb
0
 

Author Comment

by:gallandjc
Comment Utility
Looks Great! The only thing is when I import your form in my own database, it opens in full page and not like a popup window (as it does in your sample db). How can it make it look the same?
Thanks
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
set the popup property to  yes
0
 

Author Closing Comment

by:gallandjc
Comment Utility
Great, as always...
0
 

Expert Comment

by:gfranco
Comment Utility
Your code works, fine, but what is the reason when we are importing to a DB, the table has first line blank.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now