Error: Excel path specified in Registry not found on disk

89 views
Skip to first unread message

Dave Eisenbeisz

unread,
Apr 18, 2025, 12:23:44 AM4/18/25
to Excel-DNA
This error comes up every time I build an ExcelDna add-in using Visual Studio 22 Community.  Here is the error:
Excel Build Error.jpg
(Not sure why all that white space got put added to the image but whatever)

I recently upgraded to Visual Studio 22 from Visual Studio 19.  One of the differences between the versions is that in 19, you used to be able to tell Visual Studio where your parent application lives.  This seems to be removed or hidden in 22.

I am also a bit on the green side with using ExcelDna to write code for Excel, but I have done quite a few VSTO add-ins.  I am not a professional programmer but I write add-ins and windows forms applications to streamline my work as a civil engineer and make our office run more efficiently.  I generally work in vb.net (because I started with VBA 20 years ago), but I am starting to learn C# out of necessity. 

I don't know where in the registry ExcelDna looks for the path to the Excel.exe file, but I was able to find this in the registry under HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\excel.exe
Excel Path Registry.jpg
Which is the correct path to Excel.exe on my computer.  I did note that the "Path" entry is missing "Excel.exe" at the end, but I tried adding it and nothing changed so I changed it back.  By the way, I have both Office standalone 2016 (x64) and Office 365 installed, but I generally use 2016 since it is registered to my office whereas the 365 is my own personal license.  Could this be the problem?

I have tried using different versions of .net (6.0, 7.0, 8.0);  I have tried starting a new project and moving the files over to the new project several times but nothing seems to work.  VS finds the excel interop library just fine, but not the exe.

Is there a registry key or something I need to add?  This is the only location I found the path to excel.exe.  The code I am using is just a bunch of old UDFs that were written in VBA so I wanted to update them to .net.  The code compiles fine, its just the debugging that is a problem.  I don't know how helpful posting my code would be since it is just a bunch of unit conversions and engineering stuff.  I searched google, Stack Exchange, and other sites for a solution but I can't find a clear way to solve this issue. 

Anybody else run into this?

Govert van Drimmelen

unread,
Apr 18, 2025, 3:44:12 AM4/18/25
to Excel-DNA
Hi David,

You can disable the Excel-DNA build step which tries to set the debugger executable, by adding this property in your .vbproj or .csproj project file

<RunExcelDnaSetDebuggerOptions>false</RunExcelDnaSetDebuggerOptions>

Then you can configure the debugging manually by setting the Debug Properties yourself.
You need to create a new "Executable" profile, then set 
* the Executable path to something like    
        C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE
* the Command line arguments as something like
        /x "MyProject-AddIn64.xll"

I'm guessing the side-by-side Office installation is causing our build task's Excel location detection to fail.

Please write back if you're still stuck with this.

-Govert

Dave Eisenbeisz

unread,
Apr 21, 2025, 1:23:34 PM4/21/25
to Excel-DNA
Thanks for your response.  I will give your suggestion a try when I get a chance today and see how it goes.
Reply all
Reply to author
Forward
0 new messages