How to treat a user control in an Excel Task Pane like a modal dialog? - excel

I work on an Excel add-in product that contains a task pane that has multiple User Controls on it. We have moved our login process from a modal UserForms dialog to a WebBrowser control that is displayed within the Task Pane when the user clicks our Login ribbon button.
The desired behavior flow would be:
user clicks a Login button on the Ribbon - the Login control is shown in Task Pane
until there is a result of login (login succeeded, login failed, or user cancels login), the user could not use excel as though a modal login dialog is being displayed
Once logged in or login is cancelled, user can use Excel again.
In other words, I want the Task Pane control to work like a modal dialog.
I have the login control working great, however I do not know a way to have it simulate being modal. Once the user clicks the Login button, they are free to continue working in Excel, which we do not want.
I have been pondering some ugly solutions like trying to prevent each window within Excel from redrawing using WM_SETREDRAW with SendMessage and also tying LockWindowUpdate, but I was really hoping that someone would know a better way to accomplish what I was trying to do.
Btw, this type of functionality will not only be used for the login control or we might just go ahead and put it in a modal dialog. We are also wanting to do the same with a couple of other controls where we want the user to have to use the control before we allow them to continue in Excel.

Related

OfficeJS open only one dialog from ribbon - without shutdown issue

In my add-in, there are some dialogs that opened from the ribbon button (i.e. login and status).
I don't want to allow the user to open more than one dialog at a time.
When using the adding from Office for Web everything is working OK since Office for Web makes the dialog appear as a modal dialog so the user can't click the ribbon to open another one.
But when Office 365 for Windows and Mac the dialog is not modal and the user can open multiple dialogs.
I tried to create a flag in the commands.js (to tell if a window is open) file but it's not working, after a bit of investigation (on mac: defaults write com.microsoft.Excel OfficeWebAddinDeveloperExtras -bool true ) it seems like every time the user clicks the dialog button another commands window is opened so we can't store the context of if a window is open or not.
I saw this solution - to put the flag on local storage: Open only one dialog from ribbon
but the problem with this solution is that if the user exit Excel while the dialog is open (or any other unexpected scenario such as process killed or power down) next time the user will start Excel the user won't be able to open the dialog (the localStorage value will indicate that the dialog is still open).
My question(s):
Is there a robust way to prevent the user from opening multiple dialogs from the ribbon in office 365? How can I safely reset the localStorage value after a crash?
Am I missing something? Can one open the dialog in a modal manner (like in Excel for Web)?

How to trigger an event from Node.JS, where I can make a pop-up appear if the user hovers over the close button?

I'm trying to make a website where if the user hovers over the close button of a tab, I can trigger a pop-up from Node.JS. Is it possible?

Developed a Chrome extension that sent messages from context menu clicks to popup. Looking for refactoring advice

I am building a Chrome extension that add some buttons to the context menu. Upon one of the buttons being clicked, it should pass a message from the background to the popup and code in the popup should scrape the current webpage for the specified thing and save it to a firestore database. It should also display the scraped data in the popup.
The problem is that late in the project we realized that the popup code does not exist outside of when the popup is active and unless the console is active the popup closes between clicks.
Is there a way we can just inject the existing popup code into the page so it persists as a popup type thing that just sticks around?

Excel web add-in: How to detect ribbon click events?

I am working with the Excel JavaScript API and I am trying to trigger an event when the user clicks on any ribbon button or tab, and get which button or tab was clicked, but I couldn't find a way to do it.
Can anyone help me?
This isn't a supported scenario in Office.js. Your add-in is running in a sandboxed environment (either within an IFRAME or an embedded browser, depending on the platform). Even in cases where the ribbon buttons are part of your add-in, the communication is one-way (clicking the button will trigger loading a page or firing a function from your add-in).

how click a button on a web site in vb 6.0

how can i click a button on website given that i have the web browser control in my visual basic 6.0 i need it for my project where i want to automatically click a button from a series of buttons
You need to invoke the "click" event on the element.
This will cause all the client-side actions to happen as if the user clicked it with the mouse.

Resources