Control Windows Security popup when accessing a website via VBA Excel - excel

Since an Excel file, I would like to connect that intranet of our company. My problem is that the login and the password are to be written in Windows Security popup.
I don't know how to manage that without using SendKeys... Another problem linked to that is that sometimes, the popup appears again, even if the login and password are good. Do youhave an idea to the way to catch such an event?

There is a solution with SendKeys. I lauch a script contained in a VBS file at the beginning of the macro. The script waits for the appearance a the popup and send the login/password in using SendKeys.

Related

Excel hyperlink to google sheets not working

When I click on a hyperlink with gsheet url in excel, "Update your browser to use Google Drive, Docs, Sheets, Sites, Slides, and Forms" page opens in browser each time. And when I manually copy paste the link in browser, it works.
It is not caused by malware, it is likely a Windows update that causes Office and Google Docs not to communicate correctly.
See this link for more details
The thing is you cannot click on cell link, you need to hover the cell and after that click on appearing link. That's how links in google sheets work
I found a solution to overcome this challenge. Using the Shell command I was able to achieve it. I used VBA to execute the command:
Shell "explorer ""https://www.google.com"""
This command will open the URL in default browser of user.

window.opener does not work in Excel for Windows

I have built an Excel add-in, it opens a popup by window.open, then the add-in communicates with the popup site. I just realised that it does NOT work in Excel for Windows, the reason is that the popup can NOT get the host by $window.opener.
To illustrate this and avoid cross-domain, I have made a xml, which refers to the add-in and the test page. It works well in Excel Online in Chrome and in IE. However, while running it in Excel for Windows, $window.opener returns undefined.
Could anyone tell me what happened, and what's the workaround?
(for people who recommend Dialog API, please see this thread. So now neither Dialog nor window.open works in Excel for Windows).
UI.messageParent also won't work? It's from the official docs.
Example:
Office.context.ui.messageParent("Message from Dialog box")
Docs:
Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent.
(I assume this isn't the Dialog API which you referring)

Word 2016 Add-in blocked from accessing data for some Windows users

I've got a mysterious edge case with some Word 2016 users on Windows using my Word add-in.
I realize much more info might be required...but I also feel this is an issue that might have some proven ways to diagnose - or someone may know of a root cause.
My simple Word add-in pulls data from a MySQL db on my web server (via php) and stores it in localstorage. Works great in Word 2016 on multiple computers. A handful of users can't, essentially, download data and my solution throws errors for them.
I've even had 2 users on the same machine - one who can use my add-in, one who cannot (so each logging into different Windows accounts at the same institution. The user who was able to happily use my app is in IT and maybe had different settings).
My nose tells me there is an Internet Explorer security setting getting in the way...we've verified that localstorage is allowed.
When a user with the problem opens Internet Explorer directly, they're able to download data and use the app (part of it works outside of Word). As I understand it, Word 2016 Add-ins use Internet Explorer 11 to render html/js/css - and a setting changed in a user's IE11 settings area will cascade to Word 2016 add-ins.
Some of the weird details I've picked up:
Opening a new browser window from inside Word (clicking on a link in my add-in that opens a full web browser) prompts a "A website wants to open web content using this program on your computer" and points to Internet Explorer's Protected Mode. I've experimented with turning this on myself and can't recreate the issue.
The user isn't signed into O365. That doesn't seem to make a difference either.
Debugging via F12Chooser shows an [object error] with an error code of "-2147024891" and a "stack" message of "Error: Access is denied..." at the point where data would be pulled...I can't get much more out of the console.
The add-in is able to hit Firebase (I'm using Google's Firebase for authentication) and I get a response from their server...but not my ajax call to my php file.
Any thought or direction appreciated.

Automatically select save option in webbrowser file download dialog box

I have a c# desktop app which connects to a site via a web browser control. The problem is I need to navigate to a specific section and download a excel file which is generated from a postback. I would like to either automate this process or bypass the file download dialog and save the file directly to a local drive.
Problem
The link is not a standard url. The site uses a postback script to get the file needed which then displays the file download dialog box. E.g. When you click on the button (javascript: postback) the file download dialog box is automatically loaded.
As stated I want to bypass the save options and automatically store the file in a predefined location. Any help would be much appreciated.
I find AutoIt http://www.autoitscript.com/site/autoit/ very useful for these kind of tasks. If you want to integrate it with your C# app, then you can call your AutoIt script via system calls. The difficulty is finding and following the link on the page, that will depend on how the page is laid out.

Communication between a webpage and Excel?

I am trying to find a way to make a web application communicate with Excel in the same way that a desktop application could talk to it using COM. The basic description of my problem is as follows:
User selects a cell within an Excel worksheet.
User switches focus to a web application running inside a browser and clicks a button.
The clicking of the button inside the web application causes a string to drop into the open Excel spreadsheet at the cell that was previously selected.
I should reiterate at this point that I am not trying to make a webpage generate an Excel file. Rather, I am trying to have the web application directly pass a message to the open instance of Excel.
This would be straightforward if I were writing a desktop application. But in the browser context, security is going to keep the web application from communicating with Excel. I understand that it might be possible to use an ActiveX control in IE to do this sort of thing, but I would prefer allow the application to run in any browser and ensure that the user does not have to modify their browser security settings.
Can anyone suggest a workaround? One thing I wondered about is whether you could use RTD to approach the problem. I have not used RTD, so I am unfamiliar with its exact capabilities. But if the user is logged into the web application, could their button click send a message to the server that is then relied back to the Excel instance using RTD? This assumes that the user also has an Excel plugin that provides their account credentials to the RTD server.
Thanks very much.
barrowc - The button is just there to communicate with Excel.

Resources