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 8454117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:56:26+00:00 2026-06-10T11:56:26+00:00

I am trying to create a macro that will regularly move 25,000 – 35,000

  • 0

I am trying to create a macro that will regularly move 25,000 – 35,000 lines in Excel, to an Access database. As I understand it, if I’m working in an environment where people using the macro have different versions of Excel and Access (I happen to be using 2007), I’m best off using late binding, because it avoids problems with different references and versions,etc. – once it works, it works (even though it’s slower).

I’m trying to get the following code to work in Excel VBA:

Sub TransferToDB()
Dim acApp As Object

ssheet = "C:\Documents and Settings\yk\Desktop\Open Invoice Summary 322 - 2012-07-17.xlsx"
ssrange = "AllData!A1:M28323"

Set acApp = CreateObject("Access.Application")
    acApp.OpenCurrentDatabase ("C:\Documents and Settings\yk\Desktop\Open Invoice Summary.accdb")
    acApp.Visible = True
    acApp.UserControl = True
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, OpenInvoices, ssheet, True, ssrange
    acApp.CloseCurrentDatabase
    acApp.Quit
Set acApp = Nothing


End Sub

When the macro gets to the DoCmd.TransferSpreadsheet line, it stops with an error:

Runtime error 424:

Object required

This routine in Excel gets called from another routine that gathers information from many worksheets in a large workbook, and dumps it all in a sheet called “AllData” in that workbook. I keep seeing references online to this DoCmd.TransferSpreadsheet method, but I can’t seem to find any cut-and-paste code that works…

  1. Why does the routine keep crashing at that point?
  2. Is it even possible to transfer date from Excel to Access without using ADO or DAO?
  3. Is it true that late binding prevents problems, or is it better to use ADO?

Thanks – your help is much appreciated!

  • 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-06-10T11:56:28+00:00Added an answer on June 10, 2026 at 11:56 am

    This feels a little obvious, but I believe the actual cause of your error message is this:

    DoCmd is an object. Here’s an exert from the help file Application.DoCmd Property

    You can use the DoCmd property to access the read-only DoCmd object
    and its related methods. Read-only DoCmd. Syntax

    expression.DoCmd

    expression A variable that represents an Application object.

    In other words, you need to use acApp.DoCmd instead of just DoCmd. Otherwise, your code has no way of knowing what DoCmd means because it is not part of Excel.

    I’ll chime in on the other questions now as well.

    1. I’m sure it is, though I don’t know how Docmd.TransferSpreadSheet is implemented and it may use DAO or ADO without user involvement.

    2. Late binding is often necessary if you are implementing any solution with VBA that uses different Office applications than the one being used IF you have a newer version of Office than any of your users. In my experience, early binding works fine for upgrading from 2003 to 2010, but once you’ve made the change you can’t go back. Any updates to a legacy VBA will automatically update the references to the current references and destroy version compatibility. So if you use early binding and update before your users, you’ll need to switch to late-binding or stop supporting your system.

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

Sidebar

Related Questions

I'm trying to create a Macro in Excel 2007 that will delete itself when
ok so im trying to create a macro that will take my set cells
I'm trying (as a self-learning exercise) to create a Clojure macro that will generate
I am trying to create a macro that will auto close and save an
I'm trying to create a macro that selects most of the sheets in the
I am trying to create a macro that brings in the name of the
I am trying to create a Macro that either runs on close or on
I am trying to create a macro that takes a scope as a parameter.
I'm basically trying to figure out how to create a macro in Outlook that
I am trying to create a user form that will allow the user to

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.