Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ODBC excel Macro help needed
Can someone tell me what is wrong with this?
With Selection.QueryTable .Connection = Array(Array( _ "ODBC;DSN=Commerce Center;DATABASE=CommerceCenter;Trusted_Connection= Yes")) .CommandText = Array( _ "SELECT *" _ , _ "" & Chr(13) & "" & Chr(10) & "" _ , _ "FROM CommerceCenter.dbo.p21_view_inv_mast p21_view_inv_mast" _ ) .Refresh BackgroundQuery:=False End With I'm in an excel spreadsheet. I can edit the query and that works fine but from within the macro I keep getting a "Run-time error '1004' - Application-defined or object-defined error". I have shortened this query down as much a possible but still get the error. Dan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Macro Needed | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Excel Macro VBA Help Needed | Excel Programming | |||
Macro needed to set macro security in Excel to minimum | Excel Programming | |||
help needed with excel macro | Excel Programming |