Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 13th, 2012, 05: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?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:02 PM



All times are GMT -4. The time now is 02:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.