bs0d
Well-known Member
- Joined
- Dec 29, 2006
- Messages
- 622
In Excel 2013, If I record a macro for an MS Query to an Access database, the corresponding VBA code appears to be redundant, showing the query syntax twice. ONe has a .CommandType = xlCmdSql, the other has a .CommandType = 0.
In any event, if you try to run the macro, it doesn't work. If you move the ODBC query block with .commandType = xlCmdSQL to the top, then I get an error: Type Mismatch in the SQL code. However, while recording the macro, it is a successful query.
Can someone show me an example Excel 2013 MS Query code for an MS Access Database as a guide, vs. the Excel macro recorder that doesn't seem to be working for me?
I
In any event, if you try to run the macro, it doesn't work. If you move the ODBC query block with .commandType = xlCmdSQL to the top, then I get an error: Type Mismatch in the SQL code. However, while recording the macro, it is a successful query.
Can someone show me an example Excel 2013 MS Query code for an MS Access Database as a guide, vs. the Excel macro recorder that doesn't seem to be working for me?
I