I know I’ve seen references to this issue before, but I have tried several of the suggestions and I am still getting the error. I have a workbook that assembles data from another book and generates a report. I then want to make a new workbook, copy the report information into the new book, save the new book and close it, and then move on to the next report. It should do this around 10 times. In the part of my code where I am copying and pasting the sheets, I am getting an error
Error -2147417848 Automation error The object invoked has
disconnected from its clients
I have checked other postings about this error, and tried the suggested solutions without any results. the interesting thing is that sometimes it will make it through 5 cycles of code before breaking, sometimes only 2. The only consistency is that it always breaks in the same place
fromBook.Sheets(«Report»).Copy Before:=newBook.Sheets(«Sheet1»)
I have option Explicit at the top of the module, and I have checked to make sure that there are not any globals inside of the sub it is breaking in. That being said, It’s entirely possible I have overlooked something. I also put a «timer» in at one point to make sure that the excel sheets were not walking over each other.
I could really use the help!
Here is my sub’s code:
Sub CreateAndSave(ByRef Reg As Integer, ByVal j As Integer)
Dim fromBook As Workbook
Dim fromSheet As Worksheet
Dim newBook As Workbook
Dim fileExists As Boolean
Dim i As Integer
Dim Holder As Integer
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set fromBook = Application.Workbooks("Region_Audit_Report")
Set newBook = Workbooks.Add
With newBook
.SaveAs Filename:="G:DataTeamExcelDevAudit ReportRegion WorkbooksRegion" & Reg & " " & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & ".xlsx" _
, FileFormat:=xlOpenXMLWorkbook
End With
Set newBook = Application.Workbooks("Region" & Reg & " " & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & ".xlsx")
fromBook.Sheets("Report").Copy Before:=newBook.Sheets("Sheet1")
fromBook.Sheets("MonthData").Copy After:=newBook.Sheets("Report")
newBook.Sheets("MonthData").Range("A1") = "Month"
newBook.Sheets("MonthData").Range("B1") = "Store#"
newBook.Sheets("MonthData").Range("C1") = "District"
newBook.Sheets("MonthData").Range("D1") = "Region"
newBook.Sheets("MonthData").Range("E1") = "Due Date"
newBook.Sheets("MonthData").Range("F1") = "Comp Date"
newBook.Sheets("MonthData").Range("G1") = "# of Errors"
newBook.Sheets("MonthData").Range("H1") = "Late?"
newBook.Sheets("MonthData").Range("I1") = "Complete?"
newBook.Sheets("MonthData").Range("A1:I1").Interior.ColorIndex = 43
newBook.Save
newBook.Close
Application.DisplayAlerts = True
End Sub
- 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.
- Remove From My Forums
-
Question
-
Need help with an explanation and solution to this problem.
The code below creates a workbook that receives a pair of sheets from the main workbook. The code will run all day long, deleting and recreating SavNm for every time the macro is ran. The problem is when SavNm is opened and closed, subsequent
running of the macro somehow loses reference to a newly created SumWb. The copy accually completes to SumWb, but the workbook cannot be accessed after that. Any enlightenment would be appreciated.OldDAS
Sub CreateSummaryFiles(w)
Dim SavNm, OpnNm As String
Dim btm As Integer
Dim SumWb As Object
Dim Fobj As Object
SavNm = «Summary » & Qtr & » » & TargWk & «.xlsx»
If Dir(SumDir & SavNm) <> «» Then ‘if an old SavNm exists…delete it
Set Fobj = CreateObject(«Scripting.FileSystemObject»)
Fobj.deletefile SumDir & SavNm
Set Fobj = Nothing
End If
If Dir(SumDir & SavNm) = «» Then ‘create new SumWb for the one just deleted
Set SumWb = Workbooks.Add
‘The following line will run all day without incident, deleting and recreating SavNm.
‘If SavNm is opened then closed, subsequent running of the macro halts on the following line
‘with an Automation Error «the object invoked has disconnected from its client»
‘after that SumWb cannot be referenced.
Sheets(Array(«Summary», TargWk)).Copy Before:=SumWb.Sheets(1)
SumWb.Activate
SumWb.Sheets(3).Delete
Sheets(1).Select
NewBlue Avgs(w, 0)
‘do other code bla, bla bla….
SumWb.SaveAs SumDir & SavNm
SumWb.Close
End If
End Sub-
Moved by
Friday, June 6, 2014 1:57 PM
Excel dev
-
Moved by
Contents
- What is The object invoked has disconnected from its clients error message?
- How to remove The object invoked has disconnected from its clients message from Windows logon?
- Revert to a previous restore point
- Enable Secure Boot
- Reinstall Windows
- How can I fix The object invoked has disconnected from its clients error?
- Reboot your PC
- Choose a different default program
- Restart Windows Explorer
Of all the bugs that can affect your PC, the one that prevents you from logging in or opening your files must rank among the worst. Imagine trying to access your work documents, only to be confronted by the The object invoked has disconnected from its clients error message. Frustrating, right? You are not alone; many Windows users have been expressing their profound annoyance at this error, which basically renders files of a certain type redundant since they are unable to be opened.
We have come across two manifestations of this weird Windows bug. Some people get this error after starting up their computers. They get stuck on the Windows login page, which merely flashes the The object invoked has disconnected from its clients error message without accepting any user credentials. The more common iteration of this error occurs when trying to open files in certain formats. From the online chatter about this error, videos, photos, music files, word documents and Excel spreadsheets seem to be the most affected. Rarely, it even prevents certain applications from launching.
What is The object invoked has disconnected from its clients error message?
Despite the complicated-sounding jargon, this error message actually communicates something pretty simple. Whenever you get the The object invoked has disconnected from its clients message on Windows, 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
No matter what variant of the error you get or whether it is inability to access files or log in to your computer, there is no denying that this error impacts negatively on the affected users. Therefore, we have come up with some tried and verified solutions to this issue. We will first deal with the Windows logon error. After that, we will show some fixes for those who are unable to open their files because of this error.
How to remove The object invoked has disconnected from its clients message from Windows logon?
Practically, getting this error on the Windows logon screen is a real headache Without being able to access Windows, it becomes much harder to troubleshoot. Even so, there are effective methods to get rid of this error and regain access to your computer. These methods have worked for a lot of people, and there is no reason they shouldn’t work for you too.
-
Revert to a previous restore point
Getting the message The object invoked has disconnected from its clients when logging into Windows points to a systemic problem. This means that the cause must be something that has been changed in the system files. For example, 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 a restore to see if that fixes the issue.
Note that this method only works if you have previously enabled System Restore.
Tip: To enable System Restore in Windows 10, do the following:
- Type Create a restore point in Search and click the first item in the list of results. This will take you to System Properties > System Protection.
- Enable protection in Protection Settings.
- Click Configure to open up the configuration menu. You can allocate space on your hard drive for storing the restore files.
- When you’re ready to create a restore point, click the Create button.
- Return here to create a restore point before you install any major update or make significant changes to your PC.
Follow these steps to revert to a previous configuration. Since you can’t log into Windows, you have to use Windows Recovery Environment to perform a system restore:
- Click the power icon on the login screen.
- Press and hold Shift and click Restart.
- Wait as the computer restarts into the Choose an option screen.
- Click Troubleshoot, then Advanced options.
- Select System Restore.
- Wait for Windows to finish the restore process.
You might want to delete older restore points to save space on your computer. Also, after completing a restore, your PC might become a bit slower, Using Auslogics BoostSpeed will ensure that your system keeps motoring along nicely like a Formula One car. All you have to do is install it and let it perform a scan for junk files and other system-slowing items. It will delete those, keeping your PC fresh and less susceptible to annoying glitches and crashes.
-
Enable Secure Boot
You can solve the The object invoked has disconnected from its clients error on login by starting your 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.
To turn on Secure Boot, you have to go into your PC’s UEFI settings:
- Restart your computer.
- Once on the boot screen, press the appropriate key to bring up your PC’s UEFI.
- In UEFI, go to Security > Secure Boot.
- Enable Secure Boot if disabled.
- Save your changes and exit.
- Try logging in to see if the error is gone.
-
Reinstall Windows
After trying other methods without success, this is the last option you can take to remove the annoying message from your Windows login screen. Reinstalling Windows isn’t difficult if you have the installation CD. You can also use a bootable ISO stored on an external drive. Depending on the method you choose, you might need to enter your Windows product key.
- Place the bootable CD into your DVD drive or plug in the bootable external device.
- Choose Upgrade when prompted for what you want to do.
- Allow the process to complete.
You can still perform a reinstall, a refresh or a reset even if you don’t have a bootable media. All you have to do is boot into Windows RE like before:
- Boot into Windows RE.
- Select Troubleshoot from the Choose an option screen.
- Click Refresh your PC for a reinstall that keeps all your files and applications.
- Click Reset your PC if you want a clean reinstall of Windows. It will remove all your installed apps, files and settings.
How can I fix The object invoked has disconnected from its clients error?
If you can log into Windows without any problems but encounter the error when you try to open certain file types, then this section is for you. We will show you how to get rid of the error and regain access to your files.
-
Reboot your PC
This method also works for when stuck at the Windows login screen with the The object invoked has disconnected from its clients error message prominently displayed. It might not seem like much of a solution, but it is actually quite effective when dealing with errors, including this one in question. Sometimes, a restart is just what the doctor ordered for your Windows PC.
Press the power switch on your computer for a few seconds to shut down the system. Press it again to restart it. Alternatively, you can open the power icon at the bottom right of the Windows login screen and select Restart.
If you’ve recently performed an upgrade or update, there might be leftover files that require a restart to be removed. You can run Auslogics BoostSpeed for this purpose. It will find those leftover Windows installation files and delete them.
-
Choose a different default program
The error The object invoked has disconnected from its clients might be due to using native Windows applications to open files. Windows, of course, programmed some of its own applications to open photos, videos, etc. by default. If the default program isn’t working for you, then switching to another might be the solution.
The Photo app on Windows 10 has been fingered as a frequent casualty of the The object invoked has disconnected from its clients error. If this is the case for you too, you can replace it as the default image-viewing application by doing the following:
- Go to the location of the image file you are unable to open and right-click it.
- Select Properties.
- Click the Change button within the General tab to open it.
- This will bring up a window containing the image-viewing applications on your PC. Choose whichever one you like to make it your default program.
- Apply changes and exit.
If your selection doesn’t fix the issue, you can return to the General tab and make another app your default photo viewer. You can find quite a few image viewers on Windows Store. Most are free to download.
-
Restart Windows Explorer
A few users mentioned that restarting Windows Explorer had worked for them. You can as well try it too. There’s nothing to lose anyway.
- Open Task Manager.
- Find the running Windows Explorer executable in the Processes tab.
- Right-click it and select End task.
These, in a nutshell, are the most popular means of solving the error The object invoked has disconnected from its clients on Windows, as confirmed by research. Whether you can’t get past the login screen due to this error or you’re fruitlessly trying to open certain files because of it, there is a method here that should work for you. If you manage to solve the error by using one of the tips here, don’t forget to tell us about it in the comments.
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 Недавно тоже столкнулся с такой проблемой.. |
Forum Rules |
|
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||||||
1 |
||||||||
Ошибка при авторизации21.08.2018, 10:33. Показов 2313. Ответов 16 Метки нет (Все метки)
Хочу настроить автоматическую авторизацию на сайте, не получается, т.к. выдает ошибку: «automation error Если я убираю часть этого кода, то выдает вторую ошибку: «Method ‘document’ of object ‘IWebBrowser2’ failed» Помогите, в чем проблема? в гугле яндексе получается все, а в ссылке на работе нет. Код макроса:
Код формы авторизации:
__________________
0 |
… 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
|
22.08.2018, 08:50 |
2 |
Что в окне ie после navigate? Нет ли блокировок данных политиками ie? Возможно, необходимо сделать refresh страницы.
https://xxx.ru/xxx/xxx/authorization.php Я бы помог, наверное, только нужен реальный url.
0 |
0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
|
22.08.2018, 09:17 [ТС] |
3 |
URL это рабочий, поэтому перейти по нему все равно не получится, есть ли смысл в его предоставлении? Добавлено через 19 минут
0 |
ji2n … 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
||||
22.08.2018, 09:45 |
4 |
|||
Похоже, что каким-то образом ссылка ie теряет связь с объектом. Убедитесь, что ie not nothing, если всё-таки так, то
0 |
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||
22.08.2018, 11:30 [ТС] |
5 |
|||
ji2n, спасибо, так открывает, но при visible если браузер закрыт ошибка, но это ладно, теперь при определении инпута ошибку выдает Type Mismatch хотя ID верно прописан, подскажите что делать?
0 |
ji2n … 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
||||
22.08.2018, 13:04 |
6 |
|||
Вот посмотрите, сделал для Вас похожую для вашего кода задачу (код своей html Вы не дали): Кликните здесь для просмотра всего текста
0 |
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||
22.08.2018, 17:18 [ТС] |
7 |
|||
ji2n, теперь ошибка «Method ‘Document’ of object ‘IWebBrowser2’ failed». С вашим сайтом получилось, на ядексе, гугле тоже работает, а на рабочей ссылке не получается… Можете еще помочь?
0 |
ji2n … 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
||||||||
22.08.2018, 20:23 |
8 |
|||||||
IE.Document.getElementById(«s»).Value = «986697» тут id не напутали?
поставить после строки: 18
Добавлено через 45 минут
(экземпляр IE) должен быть один в памяти Выполняли? И запустить макрик с другой машины, лучше даже другой версии ОС, Офис итп. Я начинаю думать, что неполадки где-то в этом.
0 |
0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
|
22.08.2018, 22:29 [ТС] |
9 |
ji2n, завтра на работе попробую поменять строки и изменить id, его не менял потому что не дошел до него даже, через диспетчер не пробовал убить IE c другой машины тоже нет, но попробую, хотя не думаю что получится, т.к. работаем на удаленке, а там в целом все одинаково у всех. ОС и офис к сожалению поменять не получится… Я изначально думал, что так как стоит система авторизации, то может поэтому не дает ввести, т.к. при открытии ссылки по центру экрана просто появляется два инпута логин, пароль, и кнопка регистрация, может из-за этого чего-то быть? нужен ли может код страницы если не получится?
0 |
ji2n … 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
||||||||||||
23.08.2018, 08:23 |
10 |
|||||||||||
Кстатьи, еще 1 вариант: Кликните здесь для просмотра всего текста
Send = «?user_nickname=986697&submit=click» или так
Тоже в работающем примере: Кликните здесь для просмотра всего текста
0 |
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||||||
23.08.2018, 10:41 [ТС] |
11 |
|||||||
ji2n, попробовал поставить строки 22-24 после 18 ошибка «Method ‘Document’ of object ‘IWebBrowser2’ failed» на строке
При другом коде ошибка Automation error
Попробую на другом компе, отпишусь.
0 |
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||||||||||
23.08.2018, 11:56 [ТС] |
13 |
|||||||||||
ji2n, так тоже пробовал, хотел посмотреть что добавляется, в итоге ничего не добавляется, открываю вручную ссылку:
Далее ввожу логин и пароль нажимаю «Войти», ссылка меняется на:
Прогружается. Потом попадаю на нужный сайт и ссылка становится:
Добавлено через 15 минут
0 |
… 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
|
23.08.2018, 13:24 |
14 |
Всё-таки html код покажите.
0 |
rizik32 0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
||||
23.08.2018, 13:49 [ТС] |
15 |
|||
Вот код HTML для первого варианта там где user_nickname, где os_username отличается только ссылка.
0 |
… 39 / 37 / 13 Регистрация: 08.10.2016 Сообщений: 171 |
|
23.08.2018, 15:19 |
16 |
Мистика какая-то.
0 |
0 / 0 / 0 Регистрация: 13.08.2018 Сообщений: 30 |
|
23.08.2018, 17:48 [ТС] |
17 |
ji2n, вот и я уже мучаюсь третью неделю, а что такое не могу понять, поэтому решил сюда обратиться.
0 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
23.08.2018, 17:48 |
17 |