Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Downloading files in browser window after opening in Javascript?

Im trying to open a browser in Javascript and use that browser to download a file. I am doing this in a Microsoft Excel Add-in. The reason is because on MacOS on the desktop version of Excel, you cannot currently download files to the desktop via the addin.

According to the team, the workaround is to use: Office.context.ui.openBrowserWindow(url) to open the url and download the file once the browser is open.

But how do I download the file once its open? Ive tried doing something like:

Office.context.ui.openBrowserWindow("https://google.com", function() {
  const bl = new Blob([JSON.stringify(data, null, 2)], {type: "application/json"});
  const a = document.createElement("a");
  a.href = URL.createObjectURL(bl);
  a.download = "test.json";
  document.body.appendChild(a);
  a.click();
})

but im getting nothing working.

Any advice?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

openBrowserWindow doesn't take a second parameter.

I think the workaround is that you create a page on your add-in domain that has a UI for downloading the file. Then you use openBrowserWindow to open that page.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!