VSTO document level customization with visual studio 2017 - c#

I have developed a simple Excel 2010 document level customisation based on the c# project template provided with VS 2017 community.
Unfortunately I don't have much experience on Office dev but a solid experience with VBA.
It all went ok to code, debug and run the solution till the moment I tried to open an Excel file at the same moment VS had my solution opened.
The document level customisation Excel workbook disappeared. I could not get it back whether running from VS nor opening it from a folder.
I tried cleaning up the solution, uninstalling the documents (they are installed as part of the system with VSTO).
Any clue on the issue ?

IN EXCEL you can not open two file which have same name a.xls and a.xls.
"Sorry, Excel can't open two workbooks with the same name at the same time."
So; If you open a file in EXCEL, you can not open it in EXCEL Desinger.
And in some cases; if you want to open document in EXCEL; EXCEL Desinger in Visual Studio Crashes; And Desinger Generated codes lost. WHEN you reopen that solution you get errors. In order to prevent errors; Backup your Improvments or use TFS
Using WINDOWS 10, Visual Studio 2015, EXCEL 2016 And Visual Studio Tools For Office 2010 I have crash problem. And another problems that I can not properly solve.
Reverting EXCEL to 2013 resolve some problems for me. I do not see this problem on my old PC which I use; WINDOWS 8.1, VS 2015, EXCEL 2013 And VSTO 2010
Also; WINDOWS 10 And Security Updates are problematic if you use VSTO

Related

Word VSTO Add-In on Visual Studio. Why can't I open the Ribbon Visual Designer?

On computer "A", I successfully developed a Word VSTO Add-In using VS 2019 Enterprise using C#. Recently, I rebuilt the hard disk on computer "A". Reinstalled Windows 10 (version 1909). Reinstalled Visual Studio 2019 Enterprise (currently 16.5.5) including the Office/Sharepoint development workload.
On the rebuilt computer "A", I created a new VSTO Word Add-In project. Added a Ribbon (Visual Designer) to the project using this guide: Ribbon Designer
When I attempt to open the designer for the Ribbon I get a no-information error message:
No errors in the error list.
When I attempt to open the ribbon designer on the original, working VSTO add-in, same thing happens.
I have computer "B" that is configured the same as was computer "A" before I rebuilt computer "A". On computer "B", I'm able to open the ribbon designer successfully for both a new VSTO project and my original VSTO project. I compared computer "A" references to computer "B" reference and they look the same
Also verified that Office Runtime is installed
I assume I'm missing a reference. Anyone experience this? Any ideas?
Other things I tried: deleting \bin. Cleaned, rebuilt solution
I guess it will be a mystery. I ended up rebuilding the machine a second time. The only difference was that the second time around I installed Office 2016 instead of Office 2019. I was able to open the ribbon designer just fine this time around

Creating .msi file for Excel Addin with Visual Studio

maybe someone can help me with the following problem.
I create a new Excel Ribbon with Visual Studio 2017. When I run the solution out of Visual Studio everything works fine. Excel is open and the Ribbon and buttons give no exception. So far so good.
Now I need to create a .msi file, so that the solution can be roll out to the customer. Therefore I add the Visual Studio Installer projects to my VS and create a setup project. This is also working fine for, say a normal HalloWorld.exe on the Console. But when I do it for the Excel Addin it does not work. I get the .msi file, I can install it, but I never see it in Excel. I can also not see the Addin in Excel on File->Options->Addins->Com-Add-Ins.
Did anybody give me a clue what is needed, what need to be add or to change to install the Excel Addin to other users?
Best Regards,
Sebastian

Excel Addin does not compile properly on different machines

I have a very old Visual Studio Excel AddIn project.
When I compile it on my machine on VS2013 (.Net 4.0) and Office 2010 it works perfectly on the other machines. But when I compile it on TFS machine (no Office, only the vsto_redist.exe) it does not work - it does not load.
I've tried to switch on the VSTO_LOGALERTS and VSTO_SUPPRESSDISPLAYALERTS but this did not show any errors.
I've also tried to add a Microsoft.Office.Interop.Excel.dll to the project it still does not worked.
Any help on how I can see the problem will be helpful.
You need to install at lest the Excel developer tools that cinder in the box with office.

C# VSTO Project change from Excel 2010 to Excel 2007

I have a solution in VS2010 that was developed as an Excel 2007 add-in. Unfortunately something happened with my profile and since then VS runs the solution with Excel 2010. Somehow my profile got corrupted and my VS solution got corrupted too changing the Office library from 2007 to 2010. I tried changing the library back to 2007 but every time I open the VS solution VS changes it. Anyone has an idea how to fix this problem?
You must have installed Office 2010 which forces VS.NET to use the Office 14 PIAs. You can still deploy your add-in to Office 2007, you just have to be sure you don't use any Office 2010 specific features.
Also see related SO post .

Unable to load the Excel 2003 Add-in

I'm trying to develop an Excel 2003 Add-in using Visual Studio 2008 (SP1).I didn't add any code expect for the boilerplate code added by Visual Studio.
When I run the application in VS it loads up Excel, but the add-in itself does not work. The "COM Add-Ins" window list the add-in, but it's unchecked. The "Load Behavior" reads as "Not loaded.A runtime error occurred during the loading of the COM Add-in".
VS was unable to catch the exception at load-time even though I've enabled all options under Debug > Exceptions.
I also tried setting up VSTO_SUPPRESSDISPLAYALERTS Environmental variable as mentioned in this MSDN article.Surprisingly that also didn't show me any messages.
I'm running Office 2003 (SP3) under Windows XP.It'll be great if someone can help me.
Thanks.
You'll have to install KB908002. Please see
.NET app.config question
How to select .NET framework version running from Excel?
The installation with VS 2008 is a little more complicated. See here:
Can a .NET Word 2003 add-in be installed outside of the GAC?

Categories

Resources