Excel dll addin does not load - excel

I will try to make an Excel dll add-in. But I have started with the example called 'generic' in the SDK (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23242), compiled it and tried to load it in Excel. But nothing happens. If I start Excel with VS2010 debugger it doesn't even shows that Excel loads the dll. None of the addin functionality is available, and if I set breakpoints in the dll and then start Excel as debug target, no breakpoint is ever hit. Actually, they remain with the "empty-circle", meaning that to the knowledge of the debugger the dll has not been loaded.
I have carefully checked the security settings, and there is nothing that could inhibit the addin functionality there.
Any ideas?
I'm working with Excel 2010.

Definitely sounds like security settings to me. Maybe you should see if http://xll.codeplex.com works for you.

Related

Excel Custom Functions using Add-Ins: "This add-in is no longer available" error

I followed all of the steps here to try and load in a basic excel custom function add in. Everything in the setup stages seems to work, however, when I run 'npm run start:desktop' and Excel opens, there is an error on the side that says:
ADD-IN ERROR This add-in is no longer available: add-ins inserted during development are only available during debugging from Visual Studio. Please open your project in Visual Studio and re-run your application, or deploy your application into a valid catalog and re-insert
I get this error whether I run the project from the command line, VS Code, or Visual Studio. I am on Windows 10 using Excel 2016.
Here is a photo of the Excel page with the error:
Even though question is old one and I think OP must have resolved this problem. However I am currently facing the exact same problem so often. Below are my work arounds which are working for me, it might help others.
Clear Excel Cache in Trust center settings and run application again.
Many times options 1 does not work, then I make change in Add-in menifest to make it invalid and then undo these changes and run application.
If both options fails, then restart Visual Studio.
If all other options fails, restart my system, and then this issue is resolved.
If still problem persists, Uninstall Office workload from Visual studio, install it again and check. If problem persists then repair office.
These 5 workarounds have so far worked for me.
Clearing the Office cache sometimes fixes this: Clear the cache
UPDATE 1/23/2021:
There is now a troubleshooting section for this error: Getting error "This add-in is no longer available".

Office Professional 2016 Excel Office.js Add-in Browser Issue

The Add-in was working fine under Internet Explorer 11 and I was able to reliably observe and debug its behavior in Visual Studio 2017. Recently after some automatic Windows/Office updates, I noticed that iexplore.exe was not being used as the host browser. This resulted
in not being able to know what process to attach to for debugging.
At this point, out of desperation I executed the following steps to to set JS_DEBUG:
In a windows power shell window executed command
Get-AppxPackage Microsoft.Win32WebViewHost
The command listed the package information including full package name for Win32WebViewHost , which was
Microsoft.Win32WebViewHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy
I then executed the following
setx JS_DEBUG Microsoft.Win32WebViewHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy
After some poking I noticed that WWAHost.exe was being used as the browser. Now the add-in is deploying fine but is encountering strange errors.
Is it possible that the above steps resulted in WWAHost.exe as the browser being used to host the add-in. So wondering how to undo the above setting so Internet Explorer 11 is the browser used by Excel to host the add-in.
You cannot control which browser is used to host the add-in. Office decides that. For details how this is determined, see the article: Browsers used by Office Add-ins.

Breakpoints not triggering in VSTO Add-in

I was made aware of an interesting situation by my client today. I am sure it is something simple but seems like I can't put my finger on it. Have never faced this issue and Google has not been too helpful.
Problem
On my client's laptop, the Add-In is created with Add-in Express™ for Microsoft® Office and .net. When running the Add-in from VS, the breakpoints do not trigger. I logged in via teamviewer. We created a new test project (Add-in) and added this simple code.
Private Sub AdxExcelAppEvents1_WorkbookOpen(sender As Object, hostObj As Object) Handles _
AdxExcelAppEvents1.WorkbookOpen
MessageBox.Show ("Hello World")
End Sub
I put a breakpoint on AdxExcelAppEvents1_WorkbookOpen and ran. I got the message when I opened a new workbook but the breakpoint did not trigger.
I tested the same code on my laptop and it works just fine.
What has he and I tried
Unregister, Clean + Rebuild, Register
Manually cleaning the Debug folder
Repairing Add-In Express
Uninstalling/ReInstalling Add-In Express
Jumping between frameworks 4.5 and 4.6, 4.7.1
Toggling Tools | Options | Debugging | General require source files to exactly match the original version
Toggling Solution platforms (x86|64|AnyCPU)
Applications
Visual Studio Version: 2019 Pro
MS Office: 2016 Professional Plu 2016
Let me know if you need anything else?
FYI: This has been crossposted at Add-in Express forum I usually do not crosspost but seems like my client is under pressure and has to deliver this project on monday morning.
You can use the method Debugger.Break from System.Diagnostics and observe if you get more information about a plausible unhandled exception. In this case, we get the exception wkernelbase.pdb not loaded and Siddharth found it can be fixed by selecting : Tools->Options->Debugging->Symbols->Select "Microsoft Symbol Servers".
I suppose there's an {excel}.exe.config file in the Office folder. The .config requires all add-ins to use .NET 2.0 (3.0, 3.5).
That would explain the issue: you use .NET 2.0 (3.0, 3.5) while the debugger expects to use .NET 4.0 (4.X).
And yes, Add-in Express is built around the COM Add-in technology, not VSTO Add-in.

VSTO Excel add-in auto disables

I have a signed VSTO vb.net add-in that is loaded into Excel 2013. There are roughly 200 users, and 90% are having no issues. For the 10%, every time they boot Excel, the add-in is soft disabled.
I have stood next to them as they boot XL, go into COM Add-ins, check the add-in, and click ok. It loads (and works fine) without error. They then quit XL, boot XL again, and the add-in is again disabled. No "An add-in was causing issues dialog", no errors, just disabled -- if you click on the add-in name in COM Add-ins, there is no indication of any error in the Load Behavior (just "Load at Startup"). They re-enable and it works fine for that session.
The fact that it's a subset of people makes me believe it's a setting on their machine (perhaps in the Trust Center?) but I have yet to find a guilty setting. All users have the same version of Windows, and should be on the same update.
My Google searches have found lots of entries for add-ins that are misbehaving or where the Trust settings are very restrictive -- from what I can see, neither of those categories fit. I found one article that talked about the boot order with Analysis Toolpak, but none of the users assisted had Toolpak enabled.
Being that no error (either from the add-in or Excel) are displayed, I've been at a loss as to why it turns off (and why it's working perfectly on 90% of the machines).
I would appreciate thoughts on either what to look at in my code (even though there are no errors visible) or what settings to attempt.
For the 10%, every time they boot Excel, the add-in is soft disabled.
There can be a lot of reasons why your add-in is disabled automatically.
First of all, I'd suggest checking the list of prerequisites - whether they all were installed correctly (including the .net runtime)
Then I'd recommend enabling any logging mechanisms to look for any unexpected exceptions fired at startup.
There may be a conflict with other add-ins that are being loaded in the Office application. Disable all other Add-Ins except the one in question and retry.
The Antivirus on the system may be blocking the Add-In load. Run latest updates for the Antivirus and retry. If this doesn’t help, disable the Antivirus program completely and retry. Sometimes the Antivirus software also installs additional Office add-in, you may need to disable these additionally by running through the Antivirus control panel (Settings).
Visual Studio Tools for Office can write all errors that occur during startup to a log file or display each error in a message box. By default, these options are turned off for application-level projects. You can turn the options on by adding and setting environment variables. To display each error in a message box, set the VSTO_SUPPRESSDISPLAYALERTS variable to 0 (zero). You can suppress the messages by setting the variable to 1 (one). To write the errors to a log file, set the VSTO_LOGALERTS variable to 1 (one). Visual Studio Tools for Office creates the log file in the folder that contains the application manifest. The default name is .manifest.log. To stop logging errors, set the variable to 0 (zero).
Read more about possible pitfalls in the following articles:
Troubleshooting COM Add-In load failures
Troubleshooting Outlook Add-ins

debugging a sharepoint baselayoutpage

is it impossible to debug? I am running 64-bit Windows Server Enterprise, and trying to debug my solution on Sharepoint which includes a dll that has baselayoutpage pages. When I try to atttach the process to the Visual Studio debugger (VS2008) it says break points will not be hit. I have been pulling my hair out on this one, I have tried manually locating the module in debug and specifying the pdb file, but that doesn't work. i have even tried redeploying several times. There is the VSeWSS DebugReDeploy configuration I use to reploy the assembly onto the Sharepoint site.But always ends up that I am unable to debug, I have tried many things! If anyone would know why please let me know?
I have found the answer, I had to goto the project properties in solution explorer and goto the build options and click advanced from there select all configurations and select debug info as All... I hope I told it correctly, I am saying it from my memory

Resources