Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3428736
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:59:41+00:00 2026-05-18T06:59:41+00:00

I want my Access (2007) application to read the information in the different worksheets

  • 0

I want my Access (2007) application to read the information in the different worksheets of a given Excel (2007) workbook. On the internet I see a lot of examples doing this by using DAO/ADO/Excel Object Model/VBA and I think it’s rather confusing which way is best.

Now I’m doing it this way:

Dim ExcelApp As Excel.Application
Dim ExcelWorkbook As Excel.Workbook
Dim ExcelWorkSheet As Excel.Worksheet

Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkbook = ExcelApp.Workbooks.Open("C:\Temp\test.xls")

For Each ExcelWorkSheet In ExcelWorkbook.Worksheets
    MsgBox ExcelWorkSheet.Name
Next

ExcelWorkbook.Close (False)
ExcelApp.Quit
Set ExcelWorkbook = Nothing
Set ExcelApp = Nothing

(As an example I loop through the worksheets and print their names)

Is this the correct way of doing this? And is this the most efficient way? (if there is a “most efficient way”)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:59:42+00:00Added an answer on May 18, 2026 at 6:59 am

    What is best depends very much on what you want to do. If the data in Excel is structured, and you wish to import or manipulate, it is usually best to use a query with the IN keyword, or more simply, link Excel named ranges, ranges, or complete worksheets.

    Link via VBA

    http://msdn.microsoft.com/en-us/library/aa141565(office.10).aspx

    It is possible to get a full list of worksheets and named ranges with ADo Schemas.

    Query

    http://stackoverflow.com/questions/2689087/where-in-query-with-two-recordsets-in-access-vba/2689151#2689151

    If you wish to update say, SQL server from Excel via Access, ADO might be a good choice.

    ADO

    http://stackoverflow.com/questions/2086234/query-excel-worksheet-in-ms-access-vba-using-adodb-recordset/2086626#2086626

    Automation, as illustrated in your question, is usually only useful if you wish to do a lot of formatting and / or updating of single cells and small ranges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Access 2007 vba addressing an Excel 2007 workbook (WB).... This routine adds a
[SharePoint/MOSS 2007] I want to access several web services (on external sites, with WSDL
I want to Access Information of Builds of Team Projects to use them in
Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access
I have a PowerPoint 2007 slide with two embedded Excel objects. I want to
I developer a report in Access 2007 and i want to know if there
I want to move a form to the screen's left side in Access 2007
I want my users to select only time for datetime filed in access 2007.
I've just try using MS Access 2007 now I want to update a column
I'm assigning an Access 2007 query to a QueryDef in Excel VBA. My query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.