vukula Пользователь Сообщений: 4 |
#1 23.11.2015 12:09:26 Excel 2010 Если возникает, то дальнейший дебаг и запуск дает Помогите пжл. В каком направлении искать. Спасибо.
|
||
CAHO Пользователь Сообщений: 2183 |
А она возникает скорее всего, потому что макрос у Вас из модуля выполняется и обращается к конкретным ячейкам листам и диапазонам через Select. Мастерство программиста не в том, чтобы писать программы, работающие без ошибок. |
vukula Пользователь Сообщений: 4 |
#3 23.11.2015 12:43:54
Что Вы подразумеваете под «нормальными путями»? |
||
justirus Пользователь Сообщений: 295 |
#4 23.11.2015 12:49:46
Ну например: Изменено: justirus — 03.12.2015 01:06:25 |
||
CAHO Пользователь Сообщений: 2183 |
#5 23.11.2015 12:57:10 Например что-то вроде такого
Мастерство программиста не в том, чтобы писать программы, работающие без ошибок. |
||
vukula Пользователь Сообщений: 4 |
Спасибо за участие. Изменено: vukula — 23.11.2015 17:20:59 |
vukula Пользователь Сообщений: 4 |
вот что говорит микрософт
правда мне это не помогло Изменено: vukula — 24.11.2015 09:09:47 |
hyperion3330 Пользователь Сообщений: 37 |
#8 13.07.2021 18:32:31 Недавно тоже столкнулся с такой проблемой.. |
Содержание
- «Automation Error: Object Invoked has disconnected from its clients»
- 4 Answers 4
- VBA throwing «The object invoked has disconnected from its clients» error
- The object invoked has disconnected from its clients excel
- Asked by:
- Question
- All replies
- The object invoked has disconnected from its clients excel
- Asked by:
- Question
- All replies
- Detect if an object has been disconnected from its clients
«Automation Error: Object Invoked has disconnected from its clients»
I figured out what Nick was suggesting, and the following is the error number & description that I’m getting:
‘-2147417848 (80010108)’ Automation error The object invoked has disconnected from its clients
The line of code that is highlighted when I debug is:
I thought that I had seen somewhere on this or another forum to unregister then re-register a specific file, but I was at home when I came across that, and didn’t want to try it on my laptop, since everything already works 100% on it.
Once again, any help is greatly appreciated. I leave Sunday for 2 weeks, and I really need to get this working before I leave. Most of the people working for me are not excel guru’s and need all buttons/functions working, as they won’t be able to troubleshoot and/or work around the problems.
I am still sitting with the following code in a regular module, and the next set of code below that is in one of the worksheet modules.
This code is on one of the worksheets that has a command button, which calls the above code.
4 Answers 4
Ok. It’s been well over 1 month now, and I’ve finally fixed this!! Fortunately & Unfortunately, it had absolutely nothing to do with my code. Instead, it was an MS Office Vs. Windows 8 problem. To fix it, I ran the compatability troubleshooter, and all is back to perfect again:
- Open MS Excel (Any File or new file)
- Pull up Task Manager
- Click on MS Office or Excel Icon in Background Processes, Right click, and select properties
- Under Compatibility, Click «Run Compatibility Troubleshooter»
- When finished running, test file again, if it works right, click apply settings to this program. If it doesn’t work, click next and choose from the options. (I chose that it worked in previous version of Windows (Windows 7) Then click Next again.
- Test file again, and it worked.
I cannot believe that this is all I had to do the whole time! I actually spent $149 thinking that Microsoft Support could remote in and fix it, but that was an absolute waste! I was transferred to 12+ different people/departments, and still got nothing from them. I finally stumbled across the solution this morning.
Anyway, thanks to everyone who posted and tried to help me with this. I always log off of this site with better VBA skills than I signed on with because of all of you. So Thanks again!
Источник
VBA throwing «The object invoked has disconnected from its clients» error
I wrote a VBA macro in Excel quite a while back that was working flawlessly for months. Suddenly, the other day it started throwing an error, though I had not made any changes to the workbook:
The object invoked has disconnected from its clients.
I traced the error to the following lines of code.
Note that the first line runs fine every time and the second line is where the error occurs. I point this out because they are doing roughly the same types of work, but one throws the error while the other doesn’t. This isn’t my first reference to wkbTool.Worksheets(«Delq Spine») in the script.
I’m aware that solutions for this error abound. I’ve tried most of them and a few ideas of my own. For example, the following throws the same error:
Attempt 1 — Everything is a variable
Attempt 2 — The opposite
Attempt 3 — Perhaps ClearContents doing something crazy, skip it
This results in Excel crashing, though it does not throw the error first. It clearly performs the operation in the first iteration before crashing because, when Excel recovers the workbook, cell(2,3) is empty. Also, I am not using ClearContents for the first line in this attempt, just in case ClearContents is causing something in itself.
Attempt 4 — Fine, I don’t need that line anyway
I comment out the line that is causing the error. Upon looping back the next time, there is a reference to Worksheets(«Delq Spine») that works in the first iteration but not the second:
In the above, the worksheet is activated, but Excel crashes similar to Attempt 3 when assigning the formula to C2. Again, once Excel recovers, it’s clear that the operation was successful, as the formula is updated in that cell.
Attempt 5 — Surely the workbook has been corrupted
I went back through my company’s backup files to find a version of the workbook that was definitely working at the time. It ran in to the same error at the same place.
Attempt 6 — Let’s just recreate the workbook then
I recreated the workbook from scratch, including writing in all formulas and formatting the cells. I did copy/paste the VBA script to the new version because I don’t have time to rewrite it all only for it to fail again.
I will continue to add more information about attempts I made as I think of them, I’ve been working on this problem on and off for the last week.
Источник
The object invoked has disconnected from its clients excel
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I got this error: «Automation error: The object invoked has disconnected from its clients» when I try to save a document(Word), spredsheet(Excel) etc. in Office 2010.
I try it for office 2007 /2003, the issue is same.
It is a new error, my Office have worked fine with this installation before.
Can you check if the Security Update MS12-060 has been installed ?
If so, please try the following on a test machine.
Open Notepad and paste the content below the line.
Save the File as .bat and run it. Try again Word to see if you get the message.
if exist %systemroot%SysWOW64cscript.exe goto 64
%systemroot%system32regsvr32 /u mscomctl.ocx
%systemroot%system32regsvr32 mscomctl.ocx
exit
:64
%systemroot%sysWOW64regsvr32 /u mscomctl.ocx
%systemroot%sysWOW64regsvr32 mscomctl.ocx
exit
Appreciate your quick reply.
I have try to run your .bat file, but occurred this error message, means «Mscomctl.ocx has been loaded successfully but failed to call DllRegisterServer, the error code is 0x80004005.»
Max Meng
TechNet Community Support
I execute the about scripts successfully, but the automation error still exists. -_-!
Try to run Word in safe mode, and save the document again.
If this error won’t occur in the safe mode, remove the macros or disable the add-ins and check again.
TechNet Community Support
Any updates/ fresh insights on this?
I get the exact same error when trying to use «Save as» from Excel. I get it regardless of the state of the document, whether I try to save an empty document from a freshly opened Excel session or if I try to «Save as» an existing document. Just using Save on an existing document does not initiate the error.
In Word I get the message only sporadically when trying to save.
I have tried the registry fix to no avail and running in safe mode does not make any difference.
I tried reinstalling Microsoft Office (2007) — that did not help. Today IT department rolled out Office 2010 and I installed that, but I still get the same error.
As for the OP my problems started recently, and without remembering the exact date it was definitely later than the 15th of August (time of the infamous patch).
We are a pretty big organisation, and as far as I know none of my colleagues have the same problem and our IT helpdesk is miffed.
The only solution left to me now is to reinstall windows unless some clever soul in here have a tip that might remedy the issue.
Источник
The object invoked has disconnected from its clients excel
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I got this error: «Automation error: The object invoked has disconnected from its clients» when I try to save a document(Word), spredsheet(Excel) etc. in Office 2010.
I try it for office 2007 /2003, the issue is same.
It is a new error, my Office have worked fine with this installation before.
Can you check if the Security Update MS12-060 has been installed ?
If so, please try the following on a test machine.
Open Notepad and paste the content below the line.
Save the File as .bat and run it. Try again Word to see if you get the message.
if exist %systemroot%SysWOW64cscript.exe goto 64
%systemroot%system32regsvr32 /u mscomctl.ocx
%systemroot%system32regsvr32 mscomctl.ocx
exit
:64
%systemroot%sysWOW64regsvr32 /u mscomctl.ocx
%systemroot%sysWOW64regsvr32 mscomctl.ocx
exit
Appreciate your quick reply.
I have try to run your .bat file, but occurred this error message, means «Mscomctl.ocx has been loaded successfully but failed to call DllRegisterServer, the error code is 0x80004005.»
Max Meng
TechNet Community Support
I execute the about scripts successfully, but the automation error still exists. -_-!
Try to run Word in safe mode, and save the document again.
If this error won’t occur in the safe mode, remove the macros or disable the add-ins and check again.
TechNet Community Support
Any updates/ fresh insights on this?
I get the exact same error when trying to use «Save as» from Excel. I get it regardless of the state of the document, whether I try to save an empty document from a freshly opened Excel session or if I try to «Save as» an existing document. Just using Save on an existing document does not initiate the error.
In Word I get the message only sporadically when trying to save.
I have tried the registry fix to no avail and running in safe mode does not make any difference.
I tried reinstalling Microsoft Office (2007) — that did not help. Today IT department rolled out Office 2010 and I installed that, but I still get the same error.
As for the OP my problems started recently, and without remembering the exact date it was definitely later than the 15th of August (time of the infamous patch).
We are a pretty big organisation, and as far as I know none of my colleagues have the same problem and our IT helpdesk is miffed.
The only solution left to me now is to reinstall windows unless some clever soul in here have a tip that might remedy the issue.
Источник
Detect if an object has been disconnected from its clients
I am having an issue with automating an Excel file. The VBA script within Excel first opens a Word application and Word document:
And then I call a subroutine within the Word document passing some data from the Excel file:
If Excel detects that an error occurs in that subroutine, I close the Word document and Word application from Excel in a label I call Err1 :
This works perfectly fine under normal circumstances; however, if the Word document or application are closed before the Err1 label executes (such as the user manually closing the document), I get the following error:
Run-time error ‘-2147417848 (80010108)’:
Automation error The object invoked has disconnected from its clients.
which makes perfect sense because the wordApp and/or wordDoc variables still reference the Application and Document objects and those objects do not exist anymore (yet are also not considered to be Nothing ).
So here is my inquiry: Is there a way to check if an object has been disconnected from its client before the run-time error occurs so as to avoid having to rely on on error resume next ?
Update 1:
After looking at omegastripes’ answer, I realized that the error given above only occurs when the document ( wordDoc ) was the object that got disconnected. If the Word application ( wordApp ) is what got disconnected, I get the following error:
The remote server machine does not exist or is unavailable
Источник
- Remove From My Forums
-
Question
-
I got this error: «Automation error: The object invoked has disconnected from its clients» when I try to save a document(Word), spredsheet(Excel) etc. in Office 2010.
I try it for office 2007 /2003, the issue is same.
It is a new error, my Office have worked fine with this installation before.
All replies
-
Hi,
Can you check if the Security Update MS12-060 has been installed ?
If so, please try the following on a test machine.Open Notepad and paste the content below the line.
Save the File as .bat and run it. Try again Word to see if you get the message.===============================================
reg delete hkcrtypelib{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}2.0 /f
if exist %systemroot%SysWOW64cscript.exe goto 64
%systemroot%system32regsvr32 /u mscomctl.ocx
%systemroot%system32regsvr32 mscomctl.ocx
exit:64
%systemroot%sysWOW64regsvr32 /u mscomctl.ocx
%systemroot%sysWOW64regsvr32 mscomctl.ocx
exit===============================================
Take a look also at this one: http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2012/08/15/quot-unspecified-automation-error-quot-after-applying-ms12-060.aspx
Cheers, Petru
-
Appreciate your quick reply.
I have try to run your .bat file, but occurred this error message, means «Mscomctl.ocx has been loaded successfully but failed to call DllRegisterServer, the error code is 0x80004005.»
-
Edited by
Monday, August 27, 2012 3:31 AM
-
Edited by
-
@Logoncafe, please try to then run the script again with Administrator permission, hold Shift key and right click on it, and choose Run as administrator.
Max Meng
TechNet Community Support-
Edited by
Max Meng
Wednesday, August 29, 2012 4:25 AM
-
Edited by
-
Hi Max Meng,
I execute the about scripts successfully, but the automation error still exists. -_-!
-
ehmmm…
Try to run Word in safe mode, and save the document again.
If this error won’t occur in the safe mode, remove the macros or disable the add-ins and check again.
Max Meng
TechNet Community Support
-
Any updates/ fresh insights on this?
I get the exact same error when trying to use «Save as» from Excel. I get it regardless of the state of the document, whether I try to save an empty document from a freshly opened Excel session or if I try to «Save as» an existing document. Just using
Save on an existing document does not initiate the error.In Word I get the message only sporadically when trying to save.
I have tried the registry fix to no avail and running in safe mode does not make any difference.
I tried reinstalling Microsoft Office (2007) — that did not help. Today IT department rolled out Office 2010 and I installed that, but I still get the same error.
As for the OP my problems started recently, and without remembering the exact date it was definitely later than the 15th of August (time of the infamous patch).
We are a pretty big organisation, and as far as I know none of my colleagues have the same problem and our IT helpdesk is miffed.
The only solution left to me now is to reinstall windows unless some clever soul in here have a tip that might remedy the issue.
-
Edited by
olecs
Monday, September 10, 2012 12:42 PM
-
Edited by
-
I, too, was still having the error message in Excel 2010 on one user’s computer. I even tried creating a clean Excel14.xlb file, but that didn’t make a difference.
At this point I knew it was likely to be an add-in creating the issue since I was getting this error message just opening Excel without actually opening an existing file.
I went to File>Options>Add-Ins>Excel Add-Ins and unchecked «Analysis Toolpak — VBA», closed Excel, opened Excel and the message had gone away.
Then I enabled the Add-In again, but the error message did not return. So far, so good, but time will tell if this was the fix.
What actually happened under the hood, though?
Views expressed do not represent those of my employer.
-
#1
Hi, I’m getting the following error message when running a VBA macro in excel 2010,
«Run-time error ‘-2147417848 (80010102)’:
Automation error
The object invoked has disconnected form its clients. «
The issue is that on excel 2007 the macro works perfectly, however I’ve tried to run the same macro in two different computers that have excel 2010 and I can’t get the macro to work. On one of the computers I get a different error related to «not enough resources» (even though nothing is running on the background)
On both computers the macro stops in the same point:
Code:
Cells.Select
Selection.Sort Key1:=Range("A" & iRow), Order1:=xlAscending, header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
The macro is very complex and this is just part of it. I’ve seen that in some cases the solution is to add «Option Explicit» at the top of the module but it is already there.
Last edited: Jul 26, 2012
Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
-
#2
Why are you selecting all the cells on the worksheet? In fact why are you selecting at all?
-
#3
Thanks!
In a first macro data is imported from a text file, then it calls this other macro to delete unnecessary data. Please see below the whole code,
Code:
Sub deleteUnneededData()
Dim iRow As Integer
ThisWorkbook.Sheets("Source").Select
iRow = 2
Cells.Select
Selection.Sort Key1:=Range("A" & iRow), Order1:=xlAscending, header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Do Until Not IsDate(Range("A" & iRow).Value)
If DateDiff("d", Date, Range("a" & iRow).Value) < -7 Or _
DateDiff("d", Date, Range("a" & iRow).Value) > CInt(frmInitialize.lstDaysAhead.Value) Then
Range("a" & iRow).Select
Selection.EntireRow.Delete
Else
iRow = iRow + 1
End If
Application.StatusBar = "Looking for unneeded rows on row " & iRow
Loop
iRow = 2
Range("A" & iRow).Select
Do Until Not IsDate(Range("A" & iRow).Value)
If IsEmpty(Range("c" & iRow).Value) Then
Range("c" & iRow).Value = "1:00"
End If
iRow = iRow + 1
Application.StatusBar = "Looking for empty estimated times (set to 1:00) on row " & iRow
Loop
End Sub
If necessary I can post the first macro that imports the data, just let me know.
-
#4
You could try using Range(«A1»).CurrentRegion instead of Cells.
-
#5
That worked!! Thanks a lot for the help!
When logging in to Windows 11/10 or when trying to open any file (eg; videos, photos, music, Word documents and Excel spreadsheets) of a specific kind on your Windows 10 device, you may be hit with the error prompt The object invoked has disconnected from its clients. Some affected users even see this error message when trying to launch specific applications or programs. In this post, we will provide the most suitable solutions you can try to successfully resolve the issue.
D:<path-to-file>
The object invoked has disconnected from its clients.
Whenever you get this error message on Windows 10, it simply means that the specific program assigned to open files of a certain type is unable to do so. The object refers to a particular app on your PC that you have chosen to open the kind of file you’re trying to open. Its clients naturally refers to this file type. The whole error message thus tells you that the files can’t be opened because the program associated with them has been disconnected for some reason.
Other users see this error when they are trying to save their files, especially Word and Excel documents. The message appears, and the file can’t get saved. The message looks like this:
Automation error
The object invoked has disconnected from its clients
If you’re faced with this issue, depending on the scenario, that’s during Windows 11/10 logon or when opening files. you can try our recommended solutions in the sections below in no particular order and see if that helps to resolve the issue.
The object invoked has disconnected from its clients when logging into Windows 1/110
Without being able to boot Windows 10 to the desktop, it’s much harder to troubleshoot. However, there are effective methods to get rid of this error and regain access to your computer.
1] Perform System Restore
This can happen if you have recently performed an update or installed a newer version of a Windows component or an application. You can try performing System Restore to see if that fixes the issue.
2] Enable Secure Boot and Device Guard
Along with features like Device Guard and Secure Boot, Windows 10 is more secure than any of the previous Windows operating system.
This solution requires you to start your Windows 10 PC with Secure Boot enabled. When triggered, this feature stops potentially harmful applications, unsigned drivers, and unauthorized .exe files from being loaded when Windows starts up. If one of these is responsible for the error you’re getting, using Secure Boot should make it disappear.
Do the following:
- Shut your computer down.
- Start your computer up.
On the first screen, you see when your computer boots up, press the designated key on your keyboard to enter the computer’s BIOS/UEFI. This designated key varies from one computer manufacturer to another but will always be stated on the first screen the computer displays while booting up, so you can see what key needs to be pressed on that screen if you don’t already know.
- Once you’re in the computer’s BIOS, navigate to the Security tab.
- Locate the Secure Boot option in the Security tab and select it.
- Make sure that the Secure Boot option is enabled.
- Go back to the Security tab, locate and select the Device Guard option.
- Make sure the Device Guard option is also enabled.
- Save the changes you have made to the computer’s BIOS and exit it.
Once done, start your computer up and check to see if the problem still persists.
3] Perform Windows 10 in-place upgrade repair
This solution requires you to try an In-place Upgrade Repair and see if that helps. Otherwise, reinstalling Windows 10 on your device, after you have exhausted all possible options, is the last option you can take to resolve The object invoked has disconnected from its clients when logging into Windows 10.
The object invoked has disconnected from its clients when opening files
If you can log in to Windows without any problems but encounter an error when you try to open certain file types, you can try the solutions in this section to get rid of the error and regain access to your files.
1] Restart your Windows 10 device
This method also works for when stuck at the Windows login screen with The object invoked has disconnected from its clients error message prominently displayed. If you’ve recently performed an upgrade or update, there might be leftover files that require a restart to be removed.
2] Run SFC scan
This solution requires you to run an SFC scan and see if that helps.
3] Choose a different default program
If you’re getting the error message while trying to open files on your Windows 10 device, the most effective solution you can try is to change the default program or application your computer uses to open those specific files.
The Photo app on Windows 10 is known to trigger this error. If this is the case for you too, you can replace it as the default image-viewing application. If your selection doesn’t fix the issue, you can make another app your default photo viewer. You can find quite a few image viewers on Windows Store. Most are free to download.
4] Restart Windows Explorer
To restart Windows Explorer, do the following:
- Press Ctrl + Shift + Esc keys to open Task Manager.
- In the Processes tab of the Task Manager, locate the Explorer.exe or Windows Explorer process.
- Right-click on the process and select End task to force stop the process. Stopping the process might take a while.
- Once the process has been terminated, open Task Manager again. If Task Manager opens in compact mode, click or tap on More details.
- Then, open the File menu.
- Select Run new task.
- In the Create new task window, type
explorer.exe
and hit Enter on your keyboard or click or tap OK.
Your computer will restart the explorer.exe process.
When the explorer.exe process has been restarted, check to see if the issue at hand is resolved.
Hope this helps!