Open Excel file inside Visual Studio - excel

I need to open an Excel file for editing included in a Visual Basic project
I'm able to open it using Excel application. The file is opened in an external Excel instance.
Is there an extension that allows to open Excel files inside Visual Studio as other documents?
Update: I'm searching something similar to Excel Viewer but I need an extension for Visual Studio (not Code) and I need an editor to modify the content of Excel files. I think that the extension has to do something similar to How to Integrate Excel in a Windows Form Application using the WebBrowser.

Maybe you could try to modify the Excel file as a csv file instead, depending on how complex you file is (if it contains formulas it will not work). I have tried using csv before and I did not notice much difference between csv and excel files when I was using it and csv could easily get data, but if you need formulas, you may have to compute them in your code before editing the file.

I believe you can just right click on the file and select Open With > Visual Studio. Or within Visual Studio go to the Menu Bar and select File > Open and seect the file. Hope this helps!

Related

How to open .xlsx files in MS Excel from VS Code?

Is there a way to open certain files like xlsx/docx in external apps (preferably system defaults) from VS Code Explorer instead of just opening another tab in VS Code?
I want to be able to open xlsx/docx etc. in MS Office Apps by double clicking from the explorer, if that's possible at all.
After installing the extension called open, you can open ms files by default app with right click. (But it does not work in WSL)
Check this extension - both .docx and .xlsx are working good and you can even edit them.
Example of .docx:
Example of .xlsx:
If you want to open .xlsx files within vs code then this tool does the job. It is much faster then loading Excel I find.
Excel Viewer

How to set Visual Studio to view VBA files as pure text?

I have a project which is partly written in C#/C++ and partly in Excel/VBA. I use an Excel add-in which exports all VBA code from the Excel file when I saving.
This way I can use git to store all my source code for the project in a repo.
When I open the VBA files using Team Explorer and inspect changes, all source files ending with .bas, .frm and .cls are automatically interpreted as Visual Basic .NET.
As VBA and Visual Basic are not compatible all the way, Visual Studio shows errors and suggestions for the VBA code.
How do I turn that completely off? I.e view it as pure text. Or is there any way to add VBA language editor to Visual Studio?

Add-in adds button to Home without code?

I have downloaded a simple XLAM add-in (I think it's from Microsoft) to remove all non native styles from the active workbook.
This add-in adds a Remove Styles button next to Home/Styles.
However, I looked at the code in the add-in and I can't find any trace of code to add/remove this button.
Can someone explain how to do this magic trick ?
CustomUI elements are xml code that lives in the workbook. There are couple of ways you can see this.
Download the Custom UI Editor for Microsoft Office
Download the Ribbon editor from YourSumBuddy
Change the name of the file to RemoveSytles.zip (all Excel docs are really just compressed file). Open the zip file and navigate to the customUI folder. Open customUI.xml in your favorite text editor.

TFS binary files three way merge with custom tool

I have a tool for three way merge on VBA code inside Excel workbooks - let's call it XlMerge.
My Excel workbook resides inside TFS.
I hoped that if I add my tool as a user tool it will remove merging headache.
But now TFS doesn't show me "merge with custom tool" button for my xlsb file (binary workbook).
Is there any solutions to make TFS show this button?
Try looking at the source code setting for the Team Project. Non-text files are considered unmergable by TFS (e.g. a .DLL file), so you may need to make your .xlsb a type of file that's mergeable. Non-mergable files are usually indicated by a lock accompanying an edit check-out automatically.

Issue With Excel Template Files

I have been using Microsoft Excel 2003 since it first came out and am only just coming across an apparent problem with it. I have a number of .xlt files that are used throughout the company and have never had any issues with them. However, it has just come to light that there is a user who can change the template.
Ordinarily you open the Template file (e.g. Template.xlt) and on opening it find it is called Template1. On pressing the save icon you are taken to the the Save As screen with the default option to save the file as Template1.xls in MyDocuments (Default location).
In this one case though, the user opens the file as Template, and on pressing the save icon overwrites the original .xlt file. I have never seen this before and am bamboozled. Any ideas please?
How exactly does the user open the template?
If a template is opened by double clicking the .xlt (or .xltx/.xltm) file in Windows Explorer, the template generates a new Excel file based on the template.
If an .xlt (or .xltx/.xltm) is right-clicked in Windows Explorer and then the "Open" command is selected in the context menu, then the template file itself will be opened.
If an .xlt (or .xltx/.xltm) template file is opened via Excel's File > Open dialog, the template file itself is opened.
A shortcut that leads to an Excel template behaves in this way:
double-click - creates a new file based on the template.
right-click > New - creates a new file based on the template.
right-click > Open - opens the template itself.
Edit: if the behaviour of double clicking a template file (or a link to a template) occurs only for one user, you may want to unregister and re-register Excel 2003.
Quoting from this question at the Microsoft Answers forum:
> Start>Run>excel /unregserver
> - note the space between excel and /unregserver then
> Start>Run>excel /regserver
> - again note the space between excel and /regserver
I know it's not the best form to answer your own questions, but hopefully someone else will be able to benefit from the solution that I have found.
In order to solve this, download and install a program named FileTypesMan.
Run the program and find the .xlt extension. In an ordinary working system this will have at least New and Open as options with New set to default. In this case there was only Open as an option. Create an option for New and set this to default.....Presto, sorted.

Resources