(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
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.