I developed an Excel application for some users. Everything used to wrok very well until recently. When the click some buttons, the error "Automation Error: Object has disconnected from its clients" appears. Problem is, everything works very well on my PC. We run the same Excel version, same OS but I can't seem to find a solution to this problem. I'd have posted the code I'm running here but I don't know how to use the code tags and I don't want to be banned from this forum.
I have created workbooks for four health regions to collect data, which then needs to be resubmitted via FTP, but with de-identified data. The end users have little to no excel experience, thus had to make it simple as possible. Created a button that runs the macro (below) to deidentify (clear) all cells where there could possibly be personal identifying information. Runs fine on my cpu, but one user (so far) has received the error noted in the title. Both running excel 2003 with SP3 (I have version 11.8169.8172, user has 11.8316.8221), I have XP professional SP2, user has XP professional SP3. Spent hours searching and reading suggestions online, to no avail.
I seem to be coming on here every day at the moment! Someone helped me with this code, it works great apart from 1 error, which stops the script. The lines that appear when i select debug are in italic / bold. The error message appearing is:
"Object invoked has disconnect from its client" or something very similar.
'Define variables. Dim lngRowPasteTo As Long Dim codelive, codeclosed, codeassigned, vLookFor As String
I keep getting an automation error in excel 2010 when I click on the button that executes the macro. Excel crashes when the box appears. There is no code in the error box. Why I get this error message.
I am writing macros for a pop up calender in excel 2010. I followed instructions in the link below but at the testing step # 7 it returned; 'run time eror 424 object required'. It's my first time writing macros.
why a macro that works without a problem in Excel 2010 now crashes Excel 2013. The error produced says 'Automation Error Exception Occurred'. If I place a stop in the code and hold the F8 key down, the code runs perfectly (Excel 2013) but if I run it, it will crash. The code is copying a worksheet into a new workbook, adding 2 more worksheets, saving then emailing the workbook before closing. It goes through the routine about 7 times before crashing (sending only 7 email out). It's something to do with the email because I can bypass that code and it runs that part without a problem.
Our office just upgraded all the computers to Office 2013 and I've got to get this macro running again. I had to email 100 reports one-by-one today and I didn't like it.
I have a VBA macro for automatically create a word report using data in Access and Excel. The macro is hosted within a Excel document but are using both Word-, Excel and Access objects/dataTtemplates for the creation.
The errors appears what it seems randomly. The macro iterates the same code a few times even in Office 365 but then it crashes. The most common error messages are:
Run-time error '-2147417851 (80010105)':
Automation error : The server threw an exception.
Run-time error '462':
The remote server machine does not exist or is unavailable
This action cannot be completed because the application () is busy. Choose Switch To to activate and correct the problem.
(no options are working, this hang the application)
If I debug usually the error originates from the code where I ether close the workbook template I'm using:
... or when I paste a chart from Excel to the Word report:
Even more strange are that sometimes if I continue to run the macro its all working again. This ONLY happens when the client office installation is O365. Office 2013 works just fine. I thought O365 and Office 2013 was fairly equal?
I wrote a script to get stock quotes from yahoo finance and place the info on a spreadsheet. The script reruns every 15 minutes. All works fine until the computer goes to sleep, then upon waking, the error 1004 appears with the debug or exit options, telling me it cannot find yahoo finance. The error occurs because the computer takes @ 3 seconds to reconnect to the internet on waking.
If I choose debug, and continue the script it completes without error. The script will continue once again collecting stock quotes every 15 minutes until the computer exits sleep mode again.
I have tried using On Error GoTo 0 On Error Resume Next
both still result in the error 1004.
What I would like is for the error to be ignored, and the script to complete.
I have a vba script with forms that use the calendar object no longer supported in Office 2010, so I found a suitable substitute and replaced every instance of the calendar I could find across all the forms with the new solution. All seemed to work great. But when I closed the application and then reopened it, it threw an error saying there was a missing library.
When I went to the references it showed me that the Calendar object was missing. I have scoured the application for every possible instance and eliminated it, but apparently there is one or more still out there lurking in the weeds somewhere. Is there someway to search for the control that is tripping this error?
-2147417848 automation error the object invoked has disconnected from its clients
Unfortunately, I can't tell where the error is occurring because everytime it happens excel crashes or at least stops responding. I tried waiting it out (about 20 minutes) but no luck. the only thing I can do is force the program to shut down through the task manager.
The program is designed to pull information from finviz.com (a financial site), filter the data. pull the next round of data and run the filters again. there are a total of 8 queries and i think it gets hung up during the 6th or 7th run through.
Stepping through the code does not seem practical since each query might pull as many as 300 rows of data that is evaluated in a for/next loop (thats a lot of F8s).
Code: Private Sub Workbook_Open() Form1.Show End Sub
It has worked perfectly for about 2 weeks, well now when I go to open the workbook it gives me the debug error of Run Time error 424 Object Required. I last ran this today at about 8 a.m. no errors, but now about 4 hours later, it is bugging out. What is causing this?
Creating a spreadsheet to inventory cups each day. When a macro was invoked do the following:
-unprotect the worksheet
-cut/paste the completed sheet below the current
-bring in the values form the previous day's inventory
-set protection on new spreadsheet to lock the cells
-blank out old values
-reprotect the worksheet
Pretty straightforward and seems to work fine for a few iterations, then crashes with "Run-time error '-2147417848 (80010108)': Automation error. The object invoked has disconnected from its clients.".
As FYI, this code was mostly generated using a record macro session, so no variables involved.
Here is a screenshot of the spreadsheet as it sits now:
Here is the code: Sub NewDay() ' ' NewDay Macro
' Create new day and copy cup count from previous day[code]....
I created a UserForm (userform1) and added a label to it which essentially just says: "Pick a Colour"...
The other UF controls are added on the fly using the below code...however when I try to add the event to each button I get the Automation Error but I don't really understand how / why... the events are actually added to the VB project ok...
Private Sub UserForm_Initialize() Dim NewButton As MSForms.CommandButton Dim ws_i, line As Integer Dim clr_str As String For Each ws In ActiveWorkbook.Worksheets
I added a dummy routine for test purposes which is to be invoked on click of UF button control (I have tried placing this code in a standard module, within UF module etc to no avail):
Sub HIDE_WS(clr_id As Long) MsgBox clr_id End Sub
So to reiterate -- when I invoke the initialisation of the UF I get the following error:
Automation Error The object invoked has disonnected from its clients
All events are added for each control.
If I remove the adding of the events I know the UF populates with the correct controls etc...
I have some VBA code that in one portion of it an Outlook e-mail is created and the active workbook is attached and sent. This code used to work on Excel & Outlook 2003, but now in Excel & Outlook 2007 I'm getting the error:
So I haven't seen this error before. It says "Automation error: the object invoked has disconnected from its clients." I think I know what's causing it but am not sure how to go about solving the problem. Barring any inefficiences that the code below contains, can someone please tell me what code I should used to fix this error?
The project is the create checkboxes out of the tab names in a workbook. After that, create a new workbook with the selections made. It is at the point where I pass the array of sheets to be copied that the error occurs. The only thing I can figure is that my variable curWB is not what I think but I declare it to be the original workbook before that point. All of the code is below.
Another possibility is that this code with some other code sits in the worksheet called index. This sheet is being copied to the new workbook also.
VB: Private Sub CommandButton2_Click() Dim oleObj As OLEObject, ole As Object Dim sheetSelection() As String
Having problems with the code below on a 2010 Excel spreadsheet. The function flags me at first line and highlights Mid. I get a "compile error, cannot find project or library". I'm trying to set GetSheetName = m_sSheet but the GetSheetName function is not declared as returning any type.
Code: Function GetSheetName(ByVal m_sFormula As String) As String Dim m_sSheet As String
m_sSheet = Mid(m_sFormula, 2, InStr(m_sFormula, "!") - 2) If InStr(m_sSheet, "'") Then m_sSheet = Mid(m_sSheet, 2, Len(m_sSheet) - 2) End If GetSheetName = m_sSheet End Function
I am using Excel 2010, I receivean error message "end if without block if" I've been working on this forseveral days and I have been un-successful. The code is to look at what is in combox1 and based off what is selected by the user, it will locate that tab and put in the information from the userform.
Private SubCommandButton1_Click() "S:location of file.xlsx" 'UPDATES WORKBOOK
I have pulled a SharePoint list into my workbook. The list object (table) is still linked to the SharePoint list, as I'd like to synchronize it later on. I have filtered it with an autofilter. I'd like to delete all of the visible rows. I have tried a billion things to no avail. I have been searching Google for hours now. None of the examples work.