Automation Error Unspecified Error Adodb
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 Overflow the company Business automation error unspecified error excel 2007 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs automation error unspecified error vba excel Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just runtime error automation error unspecified error like you, helping each other. Join them; it only takes a minute: Sign up What is causing “Automation error Unspecified error” on Worksheet_Activate? up vote 2 down vote favorite 2 I have a worksheet named "Dates" (object
Automation Error Vba
name is A_Dates) that needs to be calculated when it is activated (It may be worth noting that this is in my Personal macro workbook). I regularly have workbooks open that have too many calculations in the for me to have auto-calculation on. So I have auto-calc set to manual, and the following code in the worksheet: Private Sub Worksheet_Activate() A_Dates.Calculate End Sub This has worked fine for the last 3 months, day-in and day-out. vba automation error unspecified error Yesterday, it stopped working. It now throws this error on the declaration line: Microsoft Visual Basic Automation error Unspecified error [OK] [Help] I have tried changing how I reference the sheet, using: Sheets("Dates").Calculate and ActiveSheet.Calculate to no avail. I've also included error handling: On Error Resume Next which doesn't prevent it. I've even gone so far as: Private Sub Worksheet_Activate() On Error GoTo headache Sheets("Dates").Calculate Exit Sub headache: Exit Sub End Sub and it still shows up. I am totally at a loss. Help? Additional Information I have the following references, and use all of them in various macros in this workbook: Visual Basic for Applications Microsoft Excel 12.0 Object Library OLE Automation Microsoft Office 12.0 Object Library Microsoft Scripting Runtime Microsoft Forms 2.0 Object Runtime Microsoft HTML Object Library Microsoft Internet Controls Microsoft ActiveX Data Objects 2.8 Library Microsoft ActiveX Data Objects Recordset 2.8 Library vba error-handling excel-2007 share|improve this question edited Sep 4 '12 at 21:43 asked Sep 4 '12 at 20:30 Farfromunique 1291112 If you comment that line out and manually force a Recalc (using [F9]) do you receive an error? –mwolfe02 Sep 4 '12 at 21:13 No, I do not. And, everything seems to calculate correctly. –Farfromunique Sep 4 '12 at 21:14 Maybe the error has to do with running any VBA,
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 automation error excel more about Stack Overflow the company Business Learn more about hiring developers or posting
Automation Error Vb6
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Vba Automation Error The Object Has Disconnected From Its Client
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Automation Error upon running VBA script in Excel up vote 3 http://stackoverflow.com/questions/12270922/what-is-causing-automation-error-unspecified-error-on-worksheet-activate down vote favorite 2 I'm getting an Automation error upon running VBA code in Excel 2007. I'm attempting to connect to a remote SQL Server DB and load data to from Excel to SQL Server. The error I get is, "Run-time error '-2147217843(80040e4d)': Automation error". I checked out the MSDN site and it suggested that this may be due to a bug associated with the sqloledb provider and http://stackoverflow.com/questions/2528152/automation-error-upon-running-vba-script-in-excel one way to mitigate this is to use ODBC. Well I changed the connection string to reflect ODBC provider and associated parameters and I'm still getting the same error. Here is the code with ODBC as the provider: Dim cnt As ADODB.Connection Dim rst As ADODB.Recordset Dim stSQL As String Dim wbBook As Workbook Dim wsSheet As Worksheet Dim rnStart As Range Public Sub loadData() 'This was set up using Microsoft ActiveX Data Components version 6.0. 'Create ADODB connection object, open connection and construct the connection string object. Set cnt = New ADODB.Connection cnt.ConnectionString = _ "Driver={SQL Server}; Server=onlineSQLServer2010.foo.com; Database=fooDB Uid=logonalready;Pwd='helpmeOB1';" cnt.Open On Error GoTo ErrorHandler 'Open Excel and run query to export data to SQL Server. strSQL = "SELECT * INTO SalesOrders FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0', & _ "'Data Source=C:\Database.xlsx; Extended Properties=Excel 12.0')...[SalesOrders$]" cnt.Execute (strSQL) 'Error handling. ErrorExit: 'Reclaim memory from the connection objects Set rst = Nothing Set cnt = Nothing Exit Sub ErrorHandler: MsgBox Err.Description, vbCritical Resume ErrorExit 'clean up and reclaim memory resources. cnt.Close If CBool(cnt.State And adStateOpen) Then Set rst = Nothing Set cnt = Nothing End If End Sub sql-server excel vba share|improve this question edited Mar 27 '10 at 4:37 shahkalpesh 25.9k23874 asked Mar 27 '10 at 4:32 bro
error unspecified error If this is your first visit, be sure to check out the FAQ by clicking the link above. You may http://www.vbforums.com/showthread.php?716245-Run-time-error-2147467259(80004005)-automation-error-unspecified-error have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. http://www.access-programmers.co.uk/forums/showthread.php?t=214548 Results 1 to 2 of 2 Thread: Run time error '-2147467259(80004005)': automation error unspecified error Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to automation error Hybrid Mode Switch to Threaded Mode Apr 1st, 2013,09:31 AM #1 teddyg View Profile View Forum Posts Thread Starter Registered User Join Date Apr 2013 Posts 1 Run time error '-2147467259(80004005)': automation error unspecified error Hi Im new to VB I trying to connect to oracle 10g data base using excel 2003 vb 6.5 Below is the code.. when i try automation error unspecified to run.. iam getting the above error [Run time error '-2147467259(80004005)': automation error unspecified error] Don't know to fix it. Anyone suggest solution Sub ConnectDatabase_Click() Dim con As ADODB.Connection Dim rs As ADODB.Recordset Dim query As String Set con = New ADODB.Connection Set rs = New ADODB.Recordset strCon = "Driver={Microsoft ODBC for Oracle}; " & _ "CONNECTSTRING=(DESCRIPTION=" & _ "(ADDRESS=(PROTOCOL=TCP)" & _ "(HOST=Teddy)(PORT=1521))" & _ "(CONNECT_DATA=(SID=25))); uid=33; pwd=admin;" con.Open (strCon) End Sub Reply With Quote Apr 1st, 2013,11:25 AM #2 RhinoBull View Profile View Forum Posts PowerPoster Join Date Mar 2004 Location New Amsterdam Posts 24,135 Re: Run time error '-2147467259(80004005)': automation error unspecified error Few questions: - why are you using ODBC and not OLEDB provider? (for proper syntax check out this site) - do you have Oracle Client installed on your machine? - if client software is installed do you have TNSNAMES.ORA file configured? Microsoft MVP - Visual Basic 2006-2013 Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database . Extra
Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 08-23-2011, 07:49 AM #1 mdlueck Sr. Application Developer Join Date: Jun 2011 Posts: 2,584 Thanks: 110 Thanked 293 Times in 282 Posts [SOLVED] Open of ADO Recordset failing, no clue why I have been having quite a fight this morning with accessing a table in my FE DB via an ADO Recordset object. I am working on creating cfg tables in both the client and server databases. Next up was to fetch the application version from each table. Then to compare and make sure the client and server code matches. Seems simple enough. So my code for the server config table works perfectly / flawlessly. Using that I capture both the run-time domain (DEV / QA / PROD) and also the version string. Next I built a class based on the class accessing the server table. Adjusted the SQL to be correct for the local FE table. The query string executes perfectly in a query window, but not so when run from an ADO object in VBA. Da code... Code: 'This API searches for the KeyValue based on the KeyName and Run-Time Domain Public Function LocateKeyValue(keyname As String) As String On Error GoTo Err_LocateKeyValue Dim adoRS As ADODB.Recordset Dim strSQL As String 'Define attachment to database table specifics Set adoRS = New ADODB.Recordset adoRS.ActiveConnection = CurrentProject.Connection adoRS.Source = "cfg" adoRS.CursorType = adOpenDynamic adoRS.LockType = adLockPessimistic 'Define a query to look for the KeyValue based on the KeyName and Run-Time Domain strSQL = "SELECT cfg.keyvalue " & _ "FROM cfg " & _ "WHERE (((cfg.keyname)='" & keyname & "') AND ((cfg.domain)='" & domain & "'));" 'Open query results adoRS.Open strSQL 'Was no record found? If adoRS.BOF Or adoRS.EOF Then LocateKeyValue = "" Else 'Fetch the values found keyvalue = Nz(adoRS!keyvalue, 0) 'And return the fetched keyvalue LocateKeyValue = keyvalue End If 'Close the database table adoRS.Close Exit_LocateKeyValue: 'Clean up the connection to the database Set adoRS = Nothing Exit Function Err_LocateKeyValue: Call errorhandler_MsgBox("Class: clsObjCfgTbl, Function: LocateKeyValue()") LocateKeyValue = "" Resume Exit_LocateKeyValue End Function At first I was getting this sort of error: Code: Date: 20110823 Time: 10:49:07 UserID: c_mlueck Error Source: Class: clsObjCfgTbl, Function: Locate