Error 1004 Odbc Excel
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack run time error 1004 general odbc error in excel Overflow the company Business Learn more about hiring developers or posting ads with us odbc runtime error 1004 Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community excel error 1004 application-defined or object-defined error of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Excel 2010: Run time error 1004 general odbc error up vote 0 down vote favorite I
Excel Error 1004 Macro
have a small Excel 2010 query that either times out (not responding) then gets the error Run time error 1004 general odbc error When I debug it highlights this line: Selection.QueryTable.Refresh BackgroundQuery:=False This was working in Excel 2007. I tried On Error Resume Next to get the query to skip any errors and move to the next part but that didn't help. Sub Refresh_all() Application.ScreenUpdating = False Application.Goto Reference:="querycell" Range("A2").Select Selection.QueryTable.Refresh BackgroundQuery:=False excel error 1004 method range of object _worksheet failed Dim pt As PivotTable Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.RefreshTable Next pt Next ws Application.Goto Reference:="returncell" Range("A1").Select Application.ScreenUpdating = True End Sub excel excel-vba excel-2010 share|improve this question edited Mar 18 '15 at 8:31 asked Feb 3 '15 at 10:10 Matt 7,594154482 Which line do you receive the error on? –Gareth Feb 3 '15 at 10:32 @Gareth ill try and get it to error again, but mostly it just times out (excel not responding). is there any syntax that isn't compatible in 2010? –Matt Feb 3 '15 at 10:46 Is it still timing out even if you remove the On Error Resume Next statement? Apart from that are you sure you are wanting to refer to the ActiveWorkbook rather than ThisWorkbook? –Gareth Feb 3 '15 at 11:02 @Gareth removed On Error Resume Next and changed it to THIS and now i get the Run time error 1004 general odbc error and when i click debug it highlights this line Selection.QueryTable.Refresh BackgroundQuery:=False –Matt Feb 3 '15 at 11:16 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted Very strange solution to this, but i'm putting it up in case a
360 games PC games excel error 1004 method range of object _global failed Windows games Windows phone games Entertainment All Entertainment
Excel Error 1004 Select Method Of Range Class Failed
Movies & TV Music Business & Education Business Students & educators
Vba Excel Error 1004
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/28296258/excel-2010-run-time-error-1004-general-odbc-error Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/184591 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
Forums Excel Questions General ODBC Error - Run time error 1004 Results 1 to 10 http://www.mrexcel.com/forum/excel-questions/433755-general-odbc-error-run-time-error-1004-a.html of 10 General ODBC Error - Run time error 1004This is a discussion on General ODBC Error - Run time error 1004 within the Excel Questions http://www.tek-tips.com/viewthread.cfm?qid=1619428 forums, part of the Question Forums category; Please help me before this laptop becomes a Frisbee! I almost have this working but I'm getting stuck on error 1004 this ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Dec 3rd, 2009,12:58 PM #1 John Wood Board Regular Join Date Sep 2008 Location excel error 1004 Ontario, Canada Posts 118 General ODBC Error - Run time error 1004 Please help me before this laptop becomes a Frisbee! I almost have this working but I'm getting stuck on this error every time I execute it. I have an ODBC with read-only privileges and I recorded part of the code from the macro. The "from" and "to" date fields I added ( I think I'm correct). I would truly appreciate the help. Here's the code: Private Sub CommandButton1_Click() Dim smpldatea As Date Dim smpldateb As Date Dim fdate1 As String Dim fdate2 As String smpldatea = UserForm1.TextBox1.Text smpldateb = UserForm1.TextBox2.Text fdate1 = Format(smpldatea, "m/d/yyyy hh:mm:ss") fdate2 = Format(smpldateb, "m/d/yyyy hh:mm:ss") Sheets("Sheet1").Activate Range("A1:H10000").ClearContents With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _ "ODBC;DRIVER={Oracle in OraHome92};SERVER=XXXXXX;UID=DT_I;PWD=RO2ACCESS;DBQ=XXXXXXP;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10" _ ), Array( _ ";FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;" _ )), Destination:=Range("A1")) .CommandText = Array( _ "SELECT DT_CENTERLINE_AUDIT.AUDIT_DATE, DT_CENTERLINE_AUDIT.CENTERLINE_ID, DT_CENTERLINE_AUDIT.COMPLIANT, DT_CENTERLINE_AUDIT.CORRECTED, DT_CENTERLINE_AUDIT.LINE, DT_CENTERLINE_AUDIT.LOCATION" & Chr(13) & "" & Chr(10) & "FROM DTD" _ , _ "BA.DT_CENTERLINE_AUDIT DT_CENT
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. VBA Visual Basic for Applications (Microsoft) Forum at Tek-Tips HomeForumsProgrammersLanguagesVBA Visual Basic for Applications (Microsoft) Forum Run-time error '1004' General ODBC Error thread707-1619428 Forum Search FAQs Links MVPs Run-time error '1004' General ODBC Error Run-time error '1004' General ODBC Error Imakeoil (Programmer) (OP) 9 Sep 10 12:41 I am trying to get an ODBC connection to work from excel. I have copied the excel sheet from a working copy and am trying to point it at a different server. I am a VBA noob and have no idea why it isn't working. Sheets("DataQuery").Selectreportdate = ActiveSheet.Range("B1").ValueRange("A3").SelectWith Selection.QueryTable.Connection = Array(Array( _"ODBC;DSN=DSN201 ;Description=JPdb;UID=minedata;PWD=1xx$F;APP=Microsoft® Query;DATABASE=Power;Network=" _), Array("DBMSSOCN;Address=111.11.221.70,1433")).Sql = Array(reportdate).Refresh BackgroundQuery:=FalseEnd WithI have not had any luck googling the '1004' error, it seems that it could be many things. Can anyone help, or point me in the direction of some good resources for setting the connection?Thanks RE: Run-time error '1004' General ODBC Error SkipVought (Programmer) 9 Sep 10 12:58 This is a very general error.Your SQL proabaly has an error.Please post your SQL.To verify, open the Immediate Window (see the View menu) and type in...CODE?Array(reportdate)and hit ENTER.COPY the resulting code and then on your sheet, EDIT the QueryTable and PASTE your copied SQL into the SQL window (see the SQL butt