Wpf forms and Office 2003 excel addin - excel

I would like to create a wpf control form that can be shown on clicking a menuitem. but this application should be an addin to excel. can someone help me here?

Not WPF,but Excel 2003 can be used to create dialogs. See the SDK or http://xll.codeplex.com and the dialog.h header file. The file error.cpp has an example of how to use it. Pretty old school, but it works.

Related

Open 'Insert Hyperlink' menu in Excel office Add-in

I want to open the 'Insert Hyperlink' menu programmatically without right clicking the cell.
https://stackoverflow.com/questions/48985342/open-insert-hyperlink-menu-in-excel-through-a-clickable-shape#:~:text=Application.Dialogs(xlDialogInsertHyperlink).Show
this link shows the way to achieve this in vba, is there a similar way for opening hyperlink menu in Excel office Add-in?
There is not yet an Office JS API similar to the Application.Dialogs API in VBA that can be used by an add-in to open Excel dialogs. Please consider logging a request for this API in the Microsoft 365 Developer Community.
An alternative might be to have the add-in provide UI similar to the Insert Hyperlink dialog either in the task pane or in a dialog.

How to know that a VSTO Word and Excel addin is being started by the Windows Explorer preview pane?

I have noticed that when users have the Windows file explorer preview pane enabled and then view a Word or Excel file, that my VSTO addin is started. Further my addin starts again when the user double clicks on a excel or word file.
What properties in Word and Excel do I need to check at startup to know that it is the preview pane?
For people's reference I did find a discussion on this for Powerpoint in this SO question.
When Word and excel are started by the file explorer as a preview then what I have found is that you can check for a commandlinearg of -Embedding
Environment.GetCommandLineArgs().Contains("-Embedding"))
Detecting Automation of Excel is where I found this answer. This question is about automation.
Also when a user embeds for example Excel in Word and then edits the embedded Excel the VSTO addin will start multiple times. You can check for the -Embedding arg for this as well.
Typically the ribbon bar is not visible when Office applications are used for rendering documents in the Windows explorer. You may use the following code to check that:
Application.CommandBars("Ribbon").Visible

Package a Ribbon with a Custom VBA Add In for Microsoft Office

I am working with Excel 2010 but I assume the idea is constant accross all of Office 2010.
I am making an Add in to have some VBA Macros that will work with all of my files and would like to make a ribbon that has buttons bound to these macros. I know how to make a ribbon through Excel Options --> Customize Ribbon but I would like to make one that is shown whenever the Add In is active. This is so I can distribute the Add in with an easy way to run the macros.
Is there a way I can do this? Thanks
UPDATE:
I have read into it and with what I have at my disposal here (Office 2010 and notepad) I am going to have to make the ribbon as an XML document and then put that with my xlam file. I am just not sure on the specifics at this point.
I suppose you are developing a VSTO based add-in. If so, you have two ways to go:
VSTO provides a Ribbon designer which you can use to build the custom UI. See Walkthrough: Creating a Custom Tab by Using the Ribbon Designer to get started quickly.
The other way is to use the Ribbon XML markup for buidling a custom UI (available for all kind of add-ins). See Walkthrough: Creating a Custom Tab by Using the Ribbon Designer for more information.
In general, the Fluent UI ( aka Ribbon UI) is described in the following series of articles in MSDN:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)
I ended up doing it by hand based on this answer.
Worked well, just a little tricky working with zipping the Excel Files. Never Unzip the entinre file, just open it with explorer and copy files into it and it worked well!

VBA created with Excel 2003 loaded OK in Excel 2007, but there's nothing in Project tree of VB editor

I have created a VBA in excel 2003 and save it in xla format. This AddIn add a new menu and some submenu in toolbar of Excel. All work well until I upgrade to Office 2007, then I open the xla file. No error message shown, but when I view the macro List, no items there. I open the Visual Basic editor. My old Project (named ML) is still there, but nothing in the Project tree, just default files as when add a new blank project.
I open the xla file with notepad, and my variable, function name are still there. Anyone has experience in this weird behavior, please give me a clue.
Thanks in advance.
Toolbar add-ins generally appear in the add-ins tab of the ribbon in Excel 2007. Make sure you have the add-ins tab displayed (if not you can turn it on under excel options).
If that still isn't working you'll need to go online and read up on altering the code to conform to the ribbon - there are a lot of resources out there should you need to do this.

Custom Menu visible to one document in Excel

I have created customized menu and toolbar in MS Excel. I wanted to show this menu and toolbar to specific document only. When I open any other xls file, it shows that menu and toolbar.
MS Excel 2003
How to do that using vba-excel macro or any other way to do that?
If you need more information, please ask me.
Thanks :)
OK - so this website will help you:
http://www.ozgrid.com/VBA/custom-menus.htm
It actually works in Excel 2007 also, but adds the menu under the Add-Ins tab.
You basically need to access the code for ThisWorkbook in the VBA application. From there, you can modify the Application.CommandBars object to do what you need.

Resources