Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
| Search | Today's Posts | Mark Forums Read
BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
This is the forum to discuss the Wrox book Excel 2007 VBA Programmer's Reference by John Green, Stephen Bullen, Rob Bovey, Michael Alexander; ISBN: 9780470046432
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 13th, 2012, 04:41 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel 2010 Run Time Error 1004 when trying to Import Access Query

I used to be able to import an Access query into Excel with the following code (relevant snippet):

strConnection = "OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;" _
& "Data Source=S:\2012 Financials\Income Statements.accdb"
Set rngDestination = Sheet1.Range("A1")

Set qryTest = Sheet1.QueryTables.Add(strConnection, rngDestination)
Application.ScreenUpdating = False

qryTest.CommandText = "qryTest"
qryTest.CommandType = xlCmdTable
qryTest.Refresh

But now with MS Office 2010 it's a hit and miss; sometime I get a "1004" run time error message stating that "the database could not be opened"....does MS Excel 2010 require a different/more efficient command for accessing the external data from Access?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004' on importing SharePoint list into Excel yukorin Excel VBA 2 December 10th, 2012 03:17 PM
Run time error 1004 jeskit Excel VBA 55 January 17th, 2011 06:09 AM
Run time error 1004 Ken Matthews Excel VBA 1 March 2nd, 2007 06:30 AM
Run-time error '1004': raja.gogoi VB Components 1 July 18th, 2004 11:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.