Solved

VBA code to import excel table in Access

Posted on 2008-06-22
6
6,043 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
ID: 21841858
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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 21841886
try this sample db
selectExcel.mdb
0
 

Author Comment

by:gallandjc
ID: 21841988
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21842036
set the popup property to  yes
0
 

Author Closing Comment

by:gallandjc
ID: 31469581
Great, as always...
0
 

Expert Comment

by:gfranco
ID: 37887958
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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