Closed Rand-Random closed 5 months ago
You can enable a higher level of logging to see the exact call that is failing - in this case you need the 'Info' level of logging enabled.
If you are targeting .NET Framework 4.x, you can use a .config file to set up the logging, with these instructions: https://excel-dna.net/docs/archive/wiki/Diagnostic-Logging
Simplest is to add this .config file next to your .xll file (with name <MyAddIn>.xll.config
), giving you a .log file after running.
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4"/>
<sources>
<source name="ExcelDna.Integration" switchValue="All">
<listeners>
<remove name="Default"/>
<add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Off"/>
</add>
<add name="File"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="ExcelDnaAddIn.log" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
If you are targeting .NET 6, you can't use the .config file, and have the following options to configure the logging:
Set environment variables to configure the logging, then restart Excel:
EXCELDNA_DIAGNOSTICS_DEBUGGER_LEVEL=Verbose EXCELDNA_DIAGNOSTICS_FILE_LEVEL=Verbose EXCELDNA_DIAGNOSTICS_FILE_NAME=ExcelDna.log EXCELDNA_DIAGNOSTICS_LOGDISPLAY_LEVEL=Verbose EXCELDNA_DIAGNOSTICS_SOURCE_LEVEL=All
Set Registry entries under either of the keys
HKEY_CURRENT_USER\Software\ExcelDna\Diagnostics
HKEY_CURRENT_USER\Software\ExcelDna\Diagnostics
Then use these values, similar to the environment variables
SourceLevel
- One of the System.Diagnostics.SourceLevel
enum values, applied as the TraceSource level.
LogDisplayLevel
- One of the System.Diagnostics.TraceEventType
enum values, applied to the built-in Excel-DNA logging display.
DebuggerLevel
- One of the System.Diagnostics.TraceEventType
enum values, applied to the debugger trace listener.
FileLevel
- One of the System.Diagnostics.TraceEventType
enum values, applied to the TextWriterTraceListener
.
FileName
- The file name for the TextWriterTraceListener
.
Thanks for the fast response.
Will come back to you once I have further data, most likely will take some days until client creates *.config file and error reoccures and provides feedback.
Sadly, never got feedback with Logs activated. They nstalled a new version of my app, which has a newer excel dna library dependecy. This seems to have solved the issue at hand. So, I don't no what caused the problem to begin with.
A client of mine is getting the following message
I am rather clueless as what could be the problem, the error only seems to happen irregullary.
Does excelDna write more detailed information somewhere, to narrow down the problem?