Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
first look at vba help
CreateQueryDef Method Example Second I would record a macro and then go to the worksheet and try the query manually from the menu Data - Import External Data - New Database Query Then select the query and see if it works. The recorded mqacro should give you the proper syntax. "MikeF" wrote: Attempting to copy an Access query into Excel. All References [dao, etc] are set properly, and all syntax below is correct. DEBUG lands here ... ("D:\ExcTst.accdb") Set MyQueryDef = MyDatabase.QueryDefs("qryTest_ToExcel") ... And Runtime Error 3343 / Unrecognized Database Format appears. How can this be fixed? Thanx, - Mike *** Here's the first part of the code in entirety: Sub RunAccessTestQuery() Dim MyDatabase As DAO.Database Dim MyQueryDef As DAO.QueryDef Dim MyRecordset As DAO.Recordset Dim i As Integer Set MyDatabase = DBEngine.OpenDatabase _ ("D:\ExcTst.accdb") Set MyQueryDef = MyDatabase.QueryDefs("qryTestToExcel") Set MyRecordset = MyQueryDef.OpenRecordset |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
Run Time Error 3343 - Unrecognized database format: | Excel Programming | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |