vysakh
vysakh

Reputation: 25

open excel document from web page using c#

I am using selenium application to download an excel file from web. The file is downloaded in read only format, that is it doesn't gets saved after downloading. But once it downloads before opening the excel throws a security warning in which it has 2 buttons-enable and disable. Since I am coding in c#, I want c# to handle that window.

That is I want c# to click on "Enable" button of that excel sheet. Is it possible?? Any comments would be really appreciated..

thanks

Upvotes: 0

Views: 936

Answers (2)

Chris H
Chris H

Reputation: 41

To add a trusted location in Excel:

  1. Click the Microsoft Office Button Button image, and then click Excel Options.
  2. Click Trust Center, click Trust Center Settings, and then click Trusted Locations.
  3. If you want to create a trusted location that is not local to your computer, select the Allow trusted locations on my network (not recommended) check box.
  4. Click Add new location.

(from http://office.microsoft.com/en-za/excel-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx#BM12)

Upvotes: 1

Henrik Gering
Henrik Gering

Reputation: 1871

I am not that familiar with selenium, but you could use native SendKeys or simular interface to navigate the popup.

A different approach could be using the windows automation api.

Upvotes: 0

Related Questions