- Remove From My Forums
-
Question
-
First off, I apologize ahead of time as I am novice to intermediate VBA developer on my best day…
The error code I have been recieving the most is 2147467259(80004005). What causes it to change slightly during my many tries at fixing it is what lines of code I comment out during the debuggin of my add-ins AutoOpen event.
The 30k view of the issue is that I have chosen to develop a dictator type app in Excel & Access 2003(much like the one called PETRAS in the excellent book «Professional XL Development, second edition», by authors, Green, Bovey, Bullen,
and Wallentin) using VBA to automate Excel (dictator type app) for the Workbook (New, Open, BeforeSave, and Close), Worksheet (Activate, Deactivate, BeforeRightMouseClick, Change, SelectionChange) and Windows (Activate & Deactivate), and manage
the data layer and windows processes.Detailed Description: Since the addin I’ve been developing uses a Access/SQL Server database and Excel Templates for data entry, it seemed natural to use Excel Menu & Command bars and Windows Dialogues for the
UI. What seems to be the entry point for this bug starts right after my AppEventClass is instantiated during the AutoOpen, which is right after I have saved the users XL settings to the registry so I can return them upon Close, and right before I begin
to build the Menu & Command bars for the app. At some point it looks like I’m losing focus of the Excel App object somehow. The specific event that instantiates my AppEventClass is the NewWorkbook I invoke as I create a copy of one of the
worksheets in my addin as a background and then paste it into a New Workbook. On the surface, most times anyway everthing seems fine. The problem happens as the addin continues to reference the Application object, like switching between windows of
different templates, and mostly for certain things like controls, command bars, and a few Excel properties. To post the code here would be rather extensive as it covers several modules and I’m assuming probably not very helpful to finding a solution
(please tell me if I am wrong).Thanks ahead of time for even thinking about this one. I’m truly hoping that hoping someone can help me resolve this bug before it shortens my life span further.
Take care…
Answers
-
Hello Jadenbanks55,
Using the clue in your description of the issue that says «What seems to be the entry point for this bug starts right after my AppEventClass is instantiated during the AutoOpen» the problem could be one of timing.
if you search in VKB using the argument Error 2147467259(80004005) you will see 10 KB articles.
see the VKB article in the list of returned articles with the title
209157 ACC2000: Access Automation Causes Run-Time Error -2147467259
http://support.microsoft.com/default.aspx?scid=kb;EN-US;209157This article has straightforward code that shows how to workaround the timing problem.
If you don’t get another reply on this thread, because of its complexity your question falls into the paid support category which requires a more in-depth level of support. Please visit the below link to see the various paid support options that are
available to better meet your needs.
http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.The engineer who takes the support incident will want you to share your VBA and your add-in so he or she can step through a reproducible test and see the same error.
-
Proposed as answer by
Friday, January 28, 2011 9:30 PM
-
Marked as answer by
jadenbanks55
Sunday, January 30, 2011 7:49 PM
-
Proposed as answer by
First i did looked at other threads and all the answer specified were didn’t helped, as i was getting this error only for specific SQL execution. Whenever i am trying to run SQL with select * from dual i was getting below error message.
Below is my VBA Code
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
StrCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=dhotname)(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=APSQ))); uid=username; pwd=password;"
cn.Open (StrCon)
vSQL = "select * from request"
rs.Open vSQL, cn
asked Apr 1, 2016 at 21:52
7
I am putting solution here, which worked for me. In other similar post it was more over connectivity issue, but in my scenario it was one of the column in table i am trying to access. In my table i had column which is having timeStamp and that’s the column was causing above error, when i removed or used formatting for that column it worked without exception. I wonder if this error would have been more explanatory, as i spend time on trying other stuff instead of just fixing my SQL.
Solution:
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
StrCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=dhotname)(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=APSQ))); uid=username; pwd=password;"
cn.Open (StrCon)
vSQL = "select request_id,user_name from request"
rs.Open vSQL, cn
Now if you look at above example i have specified exact column names, the issue here was REC_DT column which had time value. Either you can convert that value or remove column, for me that value was not required so just removed from my SQL and it worked.
answered Apr 1, 2016 at 21:55
AkshayAkshay
6472 gold badges16 silver badges36 bronze badges
Всем добрый вечер!! в строке кода: появляется ошибка: помогите пожалуйста — как ее избежать? причем — если pdf уже существует (то есть, если сохранение идет поверх существующего), то вроде ошибка не выскакивает. подскажите пожалуйста команду создания пустого pdf файла-заглушки. (не сохранять или печатать в pdf, а именно просто создать. что-нибудь типа FSO.Makefile («C:111.pdf») |
|
Юрий М Модератор Сообщений: 60390 Контакты см. в профиле |
Для начала попробуйте в диспетчере задач посмотреть — есть ли там среди открытых документов Ваши. И закройте там же само приложение. |
процесса WINWORD.EXE нету даже если есть куча процессов WINWORD.EXE — перезапись(!) файла делается отлично, при условии, если файл pdf уже существует. таким образом, ошибка появляется только при создании нового файла. вот и хочу перед выполнением функции создавать макросом пустой файл-заглушку, чтобы он в любом случае перезаписывался и не было ошибок |
|
вставила перед выполнением функции: |
|
Hugo Пользователь Сообщений: 23137 |
Бывает, что в корень C запрещает писать система или антивирус. |
а вот еще нашла решение: http://tiny.cc/u28bdw по первичным тестам ошибка тоже не выскакивает вместо: заменить на: |
|
точнее так: |
|
_Лена_ Гость |
#8 26.04.2012 00:57:19 а нет ну буду значит через пустой файл-заглушку делать (msg 26.04.2012, 00:13) |
-
07-11-2019, 10:15 AM
#1
Registered User
run-time error ‘-2147467259 (80004005)’ when sending emails via vba
I’m basically writing a macro to send emails to people when their tasks are overdue. I’m getting multiple problems with this. I have wrote the following code:
The email looks at the email in column 13 and sends an email to them based on the conditions wrote in the code. I have set it up so that it runs whenever the spreadsheet opens. The macro DOES do what it is intended, however, I get an error on the line «olMail.Send» saying «run-time error ‘2147467259 (80004005): we need to know who to send this to. Make sure you enter at least one name.»
Is there any reason for this? Whilst it does do what I need to as is, I don’t like the error that’s popping up, and may cause others to panic should they use this spreadsheet.
-
07-11-2019, 10:24 AM
#2
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Have you checked what the value of x is when the error ocurrs? It is possible that there is a blank cell in M on a row? (lastrow for example may be a lower row than the last email address in your M column)
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone’s input useful, please take a second to click the * at the bottom left to let them knowThere are 10 kinds of people in this world… those who understand binary, and those who don’t.
-
07-11-2019, 11:10 AM
#3
Registered User
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
It says the value of x is 23, but I only have 22 rows in the table currently. It also says that last row is 30…I’ve tried to «delete» these rows to see if anything is in there but nothing changed.
I decided to add rows up to row 31 to see if this changed anything. The same error occurred, except it says the value of x is 31 and last row is 39. Exact same thing happened when I added rows up to 107 (x = 108 and lastrow 115).
Funnily, when I delete the rows, it still says last row is 115. So maybe this is a formatting issue?
But you are correct. There is a blank cell in M on a row which is causing the error.
-
07-11-2019, 11:18 AM
#4
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Without the sheet I can’t troubleshoot the «last row» issue, but you could always implement a check and skip any row where M is blank:
If the email column can be relied on to determine what the last row is, then you could use:
It might still be good to leave the check for blank M rows though, so that if a row in the middle doesn’t have an email address, you won’t get an error.
Last edited by Arkadi; 07-11-2019 at 11:24 AM.
-
07-11-2019, 11:33 AM
#5
Registered User
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Wow this works perfectly, thank you so much!
-
07-11-2019, 11:39 AM
#6
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Glad to hear it
Thanks for the rep, the feedback, and marking the thread as solved!
-
07-11-2020, 06:56 AM
#7
Registered User
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Hello ! I am trying do deploy a similar vba code. The end goal is to load an excel file and extract some data in it including some emails. After that another macro is triggered which sends mails. Unfortunately, when there are no email addresses populated into the file, I get the same error message. Could please help me solve this issue and modify my macro. I use the following code:
-
07-11-2020, 08:52 AM
#8
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
Hi Yoanna,
We�ll be happy to help but you�ll have to start your own thread please.
-
07-11-2020, 01:37 PM
#9
Registered User
Re: run-time error ‘-2147467259 (80004005)’ when sending emails via vba
HI, Arkadi!
Thanks for your answer. I started a new thread
-
#1
I have a code, which runs on a button hit.
When you hit the button, it adds a path paramterers to the variable mappa, and then from that it creates a new file.
After that I’m connecting to sql, then I want to export datas based on the values of the cells. The values of the cells is given to a variable, and I want to give the sql those variables values.
I don’t know if this is correct but without these lines its gives the same error, so I can’t even try them out!
So on the end it gives me an error like this.
Run-time error ‘-2147467259 (80004005)’:
Automation error
What could it mean? And how can I fix it?
Sub INDITAS3(mappa As String)
‘excel.txt megnyitása
Workbooks.OpenText Filename:= _
mappa & «excel.txt», Origin:=1250, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=True, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1)), TrailingMinusNumbers:=True
‘——csatlakozás
Dim cn As ADODB.connection
Dim strConn As String
Dim strSQL As String
Dim strXLSource As String
‘kapcsolódás
strConn = strConn & «Provider=SQLOLEDB;Data Source=;»
strConn = strConn & «Initial Catolog=;Trusted_Connection=YES»
Set cn = New ADODB.connection
cn.Open «DRIVER={MySQL ODBC 5.1 Driver}» _
& «;SERVER=localhost» _
& «;DATABASE=test3» _
& «;UID=root» _
& «;PWD=root» _
& «;OPTION=16427»
strXLSource = «c:davidNE_Arfolyam 2.xlsm;Extended Properties=Excel 12.0»
‘———
‘excel.txt feldolgozása
Dim wb As Workbook
Set wb = Workbooks(«excel.txt»)
Dim ws As Worksheet
Set ws = wb.Sheets(1)
‘ThisWorkbook.Activate ‘az NE_Arfolyam excel fájl aktiválása
Dim datumido As String
datumido = ws.Range(«A1»).Value ‘az A1 cella értékét átadjuk a datumido változónak
Dim nev, valutaneve As String
Dim i As Integer
Dim v_eladas, v_vetel As Integer
i = 2
Do While ws.Range(«A» & i).Value <> «» ‘???addig amíg A i-edik értéke #
If ws.Range(«A» & i).Value <> «***» Then ‘hogyha a létrehozott excel file A oszlop +i-edik értékén *** van akkor befejezi
‘1es if
If ws.Range(«A» & i).Value = «#» Then ‘hogyha a létrehozott excel file A oszlop +i-edik értékén # akkor megy tovább a kódban mert a fájlban # után valuták vannak
nev = ws.Range(«B» & i).Value ‘a megnyitott excel file B2-es mezőjében szereplő értéket a nev változónak adjuk
strSQL = «INSERT INTO arfolyam (irodanev)»
strSQL = strSQL & «VALUES («» & nev & «»)»
‘1es else
Else
‘konkurencia árfolyam megfelelő helyre írása
valutanev = ws.Range(«A» & i).Value ‘itt megkapjuk a valuta nevét
strSQL = «INSERT INTO arfolyam (valutanev)»
strSQL = strSQL & «VALUES («» & valutaneve & «»)»
v_eladas = ws.Range(«B» & i).Value
strSQL = «INSERT INTO arfolyam (eladas)»
strSQL = strSQL & «VALUES («» & v_eladas & «»)»
v_vetel = ws.Range(«C» & i).Value
strSQL = «INSERT INTO arfolyam (vetel)»
strSQL = strSQL & «VALUES («» & v_vetel & «»)»
End If ‘1es else
End If ‘1es if
i = i + 1
Loop
Debug.Print strSQL
cn.Execute strSQL, adExecuteNoRecords
<— IT GIVES THE ERROR HERE
End Sub
Last edited: Aug 21, 2012
Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
vds1
Well-known Member
vds1
Well-known Member
-
#3
Can you post debug.print StrSql value dispalyed in Immediate window ?
Last edited: Aug 21, 2012
-
#4
Can you post debug.print StrSql value dispalyed in Immediate window ?
It writes this:
INSERT INTO arfolyam (vetel)VALUES (» & v_vetel & «)
Even if I comment out all the lines from Do While to Loop
It writes an error (but this time with another number)
Run-time error ‘-2147217908 (80040e0c)
Automation error
Last edited: Aug 21, 2012
vds1
Well-known Member
-
#5
It writes this:
INSERT INTO arfolyam (vetel)VALUES (» & v_vetel & «)Even if I comment out all the lines from Do While to Loop
It writes an error (but this time with another number)Run-time error ‘-2147217908 (80040e0c)
Automation error
There are lot of bugs in your code..
You May want to check the connection to MYSQL database
SQL Statment are not properly syntaxed..
Generally its ,
INSERT INTO table_name
VALUES (value1, value2, value3,…)
-
#6
Thing is that this connection method is working in another module, I’ve just copy/paste it, but it won’t work!
As I said I’ve commented out every line from the Do while to the Loop, so they dont interfere, but there is still an error!
How is it possible that, this connection code is worked (and is working) on another module, but not here?
vds1
Well-known Member
-
#7
Check the Reference to ADO in your new workbook.. To do this Goto VBA editor > Tools > Reference > Microsoft Activex Data Objects 2.0 Library has to be checked..
-
#8
Yes that is checked!
Heres a code from another module it works fine without any problem! What could be the problem with the first one??
Sub export()
‘———-Adatok exportálása adatbázisba
Dim cn As ADODB.connection
Dim strConn As String
Dim strSQL As String
Dim strXLSource As String
‘kapcsolódás
strConn = strConn & «Provider=SQLOLEDB;Data Source=;»
strConn = strConn & «Initial Catolog=;Trusted_Connection=YES»
Set cn = New ADODB.connection
cn.Open «DRIVER={MySQL ODBC 5.1 Driver}» _
& «;SERVER=localhost» _
& «;DATABASE=test3» _
& «;UID=root» _
& «;PWD=root» _
& «;OPTION=16427»
strXLSource = «c:davidNE_Arfolyam 2.xlsm;Extended Properties=Excel 12.0»
‘—-
Sheets(«Setup»).Activate ‘setup munkalap aktiválásaFor i = 4 To 16
strSQL = «INSERT INTO valuta (nev)» ‘itt adjuk meg, hogy mely sql mezőkbe akarunk értéket beszúrni.
strSQL = strSQL & «VALUES («»» & Cells(i, 16).Text & «»»)» ‘melyik sor, melyik oszlop értékét adjuk be mivel a táblában Valuta_Lista mező varchar ezért » » közé kell tenni az értéket!
cn.Execute strSQL, adExecuteNoRecords ‘végrehajtás
Next icn.Close ‘kapcsolat lezárása
‘————exportálás vége
End Sub
-
#9
I’ve rewrited the code a bit, it should work, but i have the 80040E14 error code! Still don’t know why it happens
Heres the code:
Code:
Option Explicit
Sub INDITAS3(mappa As String)
'excel.txt megnyitása
Workbooks.OpenText Filename:= _
mappa & "excel.txt", Origin:=1250, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=True, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1)), TrailingMinusNumbers:=True
'----------Adatok exportálása adatbázisba
Dim cn As ADODB.connection
Dim strConn As String
Dim strSQL As String
Dim strXLSource As String
'kapcsolódás
strConn = strConn & "Provider=SQLOLEDB;Data Source=;"
strConn = strConn & "Initial Catolog=;Trusted_Connection=YES"
Set cn = New ADODB.connection
cn.Open "DRIVER={MySQL ODBC 5.1 Driver}" _
& ";SERVER=localhost" _
& ";DATABASE=test3" _
& ";UID=root" _
& ";PWD=root" _
& ";OPTION=16427"
strXLSource = "c:davidNE_Arfolyam 2.xlsm;Extended Properties=Excel 12.0"
'----
'excel.txt feldolgozása
Dim wb As Workbook
Set wb = Workbooks("excel.txt")
Dim ws As Worksheet
Set ws = wb.Sheets(1)
'ThisWorkbook.Activate 'az NE_Arfolyam excel fájl aktiválása
Dim datumido As String
datumido = ws.Range("A1").Value 'az A1 cella értékét átadjuk a datumido változónak
Dim nev, valutaneve As String
Dim i As Integer
Dim v_eladas, v_vetel As Integer
i = 2
Do While ws.Range("A" & i).Value <> "" '???addig amíg A i-edik értéke #
If ws.Range("A" & i).Value <> "***" Then 'hogyha a létrehozott excel file A oszlop +i-edik értékén *** van akkor befejezi
'1es if
If ws.Range("A" & i).Value = "#" Then 'hogyha a létrehozott excel file A oszlop +i-edik értékén # akkor megy tovább a kódban mert a fájlban # után valuták vannak
nev = ws.Range("B" & i).Value 'a megnyitott excel file B2-es mezőjében szereplő értéket a nev változónak adjuk
'strSQL = "INSERT INTO arfolyam (irodanev)"
'strSQL = strSQL & "VALUES ("" & nev & "")"
'1es else
Else
'konkurencia árfolyam megfelelő helyre írása
valutaneve = ws.Range("A" & i).Value 'itt megkapjuk a valuta nevét
v_eladas = ws.Range("B" & i).Value
v_vetel = ws.Range("C" & i).Value
strSQL = "INSERT INTO arfolyam (irodanev,valutanev,vetel,eladas,datum)"
strSQL = strSQL & "VALUES (" & nev & ",""" & valutaneve & """,""" & v_vetel & """,""" & v_eladas & """,""" & datumido & """)"
Debug.Print strSQL
cn.Execute strSQL, adExecuteNoRecords
End If '1es else
End If '1es if
i = i + 1
Loop
cn.Close
End Sub
Plus information that I have a database with the following tabel / fields:
It might be that I’m doing something wrong with the database?
-
#10
I’ve got the solution!
It was a syntax error which is generated by the » signs in the part where I want to insert.
The correct line is below, for those who have similar issue it might help:
Code:
strSQL = strSQL & "VALUES (""" & nev & """,""" & valutaneve & """,""" & v_vetel & """,""" & v_eladas & """,'" & datumido & "')"
Skip to content
A few weeks ago, out of nowhere, I started receiving the following error when I started Excel after a restart or resuming from a locked computer.
Run-time error ‘-2147467259 (80004005)
[Microsoft][ODBC Microsoft Access Driver] ‘(unknown)’ is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
I have a ton of add-ins that load at startup and more than a few of them connect to an Access database via ActiveX Data Objects (ADO). The offending code was simply establishing the ADO connection.
Sub ConnectToMRP() If gcnMRP Is Nothing Then Set gcnMRP = New ADODB.Connection gcnMRP.Open gsMRPConn End If End Sub |
The global constant, gsMRPConn
, pointed to the file correctly. I was able to access the network share via Windows Explorer. But when I executed the code
I got 0
, meaning VBA couldn’t resolve the path. The fix for a while was to close Excel and restart. Sometimes one restart would fix it and other times it took up to five restarts. I was at a loss for why VBA couldn’t see the network share.
After much searching, I read something about offline files. I had no idea what offline files were or why I would want them. Apparently Windows makes a cache of network files locally so that I can access them when I’m not on the network. I typed “offline files” in the Win7 start menu and found the Offline Files dialog.
I disabled offline files and have not had the problem since. I still don’t know how offline files work. I was connected to the network, so there was no need for Windows to use files offline. And if it had a cache, I’m not sure why it didn’t use it. I guess Windows was working to sync offline files in the background, which is why it worked after some number or restarts. I’m just glad the nightmare is over.
Tuesday, June 23, 2009
Peltier Technical Services, Inc., Copyright © 2023, All rights reserved.
In recent months I have encountered a particularly troublesome error. It occurs in Excel 2003 and 2007 (and perhaps in earlier versions, but I don’t recall any such cases). The error is heralded by an unusually unhelpful error message, even my Microsoft’s standards: Microsoft Visual Basic – System Error &H80004005 (-2147467259). Unspecified error.
Pardon my French, but WTF?
To rub salt into the wound, this is followed up with an Out of Memory error:
Sometimes these occur once, sometimes twice, when Excel is started, when a workbook with code is opened, or when an add-in is opened.
Association with RefEdit Controls
Closer examination sheds some light on the problem. It seems to be related to our old friend, the RefEdit control. If a workbook or add-in has a UserForm with a RefEdit, this error may occur. When the error occurs, it may be impossible to view the UserForm in the VB Editor, or if the UserForm can be viewed, any RefEdits have been stripped off the form. UserForms without RefEdit controls can be viewed with no problems.
On a computer that experiences the problem, the RefEdit library (refedit.dll) is not available in the references under the VB Editor’s Tools menu,and sometimes it turns up as a MISSING reference in this list. The RefEdit library is also not found in the list of Additional Controls which can be added to the VBE’s Controls Toolbox. If the RefEdit control had been present on the Controls Toolbox, its place may be taken by a gray square with a tooltip of “Unknown”.
Interestingly enough, the RefEdit library is present on the machine, in the Microsoft Office program directory. But the library is apparently not accessible.
There have been some recent changes in the RefEdit control, I believe on more than one occasion, but I have never documented the changes. There are no outwardly visible differences in the control, but the file size has changed, the file created or modified date has changed, and the file version has changed.
History
This famous Unspecified Error, its hex code 80004005 burned into many a programmer’s retinas, has been around for a long time, in Visual Basic 6 and probably earlier. It has been blamed on many factors, many of which seem like wild guesses, and most of which are irrelevant to our situation here. There are a lot of instances in which this error occurred in projects which dealt with retrieval of data from data controls or databases (Access, Oracle, SQL Server, and others). This error has also been associated with ODBC, ADO, IMAP, ASP and IIS, and DLLs from Microsoft (INET and HTML controls) and third parties. I suspect that this is a catch-all error message when there is an internal error in VB, when there is no specific information but the error is somehow associated with various controls or libraries.
At least one Microsoft Knowledge Base article discusses this error in the context of Excel. OFF2000: “System Error &H80004005 (-2147467259)” Running Macro with UserForm attributes the error to opening a file with a userform that contains a Microsoft DirectAnimation Sprite control (daxctle.ocx), whatever that is. Apparently that was the Office 2000 version of the problem, and in Office 2003/2007 it’s kicked off by a RefEdit control.
Google finds innumerable links to this error in web sites and newsgroups, related to Visual Basic, Office, and recently, Excel. I have spent dozens of hours poring through search results looking unsuccessfully for relief.
What makes this problem so much harder to document and troubleshoot is that it does not occur on all computers which have had nominally the same upgrades. One user will be hobbled by this error, while a user in the adjoining cubical will show no signs of it. I have had substantially identical VMs on the same computer, some with the problem, some immune.
Remedies
This problem has surfaced among users of my charting utilities, but usually I’ve been able to fix it. Also, one of my clients has a large Excel add-in package which has experienced this error. So far I think we’ve successfully treated all infections. (And no, I’m not the Excel Doctor.)
I have tried a wide range of remedies. A few involve chicken’s blood at full moon, but most involve various Windows and Office activities. Some remedies work some of the time, but what works on one computer may not work on another.
Because this problem was sporadic when I first encountered it, I didn’t document the exact steps taken to diagnose and remedy the issue. I’ve generally followed a brute force approach until recently.
In mild cases, deleting all files in the user’s temp directory and in the C:Documents and SettingsUser NameApplication DataMicrosoftForms directory will clear up the problem. This is all that my main machine needed, but generally it’s like trying to boil the ocean.
Reregistering the refedit.dll does not seem to help. I have tried replacing an older version of this library with a newer version from another computer, but I don’t recall this ever having helped.
Lately it seems that almost all cases in Excel 2003 are fixed using the Help menu’s Detect and Repair command, so this is my first step in treating the malady. Excel 2007 has a similar command deep under the Office Orb (Excel Options > Resources > Run Microsoft Office Diagnostics > Diagnose). I’ve used this command, but it has never given me the same warm fuzzy feeling of a Detect and Repair operation. However, just today an end user ran the diagnostics, and the problem was cleared up.
There are a couple preventative measures which seem to make add-ins resistant to the unspecified error. Open the add-in in Excel 2000, uncheck the reference to the RefEdit library, compile the code (ignoring compile errors related to new Excel 2002-2003-2007 syntax), and save and close the add-in. The compile step may not be necessary. I’ve also removed RefEdit controls and replaced them in 2000, but this seems to be unnecessary (as well as tedious).
I’ve seen two or three cases in which these last few steps did not seem to work. But in at least one of these cases, I’m not sure the end user followed instructions and actually ran the Detect and Repair or Diagnostic command.
Update 23 June 2009
Bob Flanagan has shared a link to his detailed protocols for fixing this and other problems with Office installations at What to do if Excel add-ins do not run. Thanks, Bob.
Other Experiences
Have you encountered this problem? Have you documented it? Have you successfully treated it?
If so, I want to hear about it. Please leave a comment with as many details as you can muster.