tags:

views:

29

answers:

1

Hello. I have a Watin script that logs into a site and generates a report in excel format. I'm having a really hard time saving the generated excel file. I thought my answer was using the GetActiveObject method in interop services. I don't get an error using that, but it doesn't seem to find it either.

More info if it's any use: The original browser window remains in the background and the excel sheet generated has a name of "xxx.aspx". It's NOT in a browser window as it shows up as excel in the task bar.

Any help attaching to the new excel window would be greatly appreciated because I'd like to save it to disk.

A: 

WatiN only automates the browser so once the file is open in Excel WatiN is no longer helpful to you. You might want to ask this question without reference to WatiN since it is strictly a .NET/interop scenario. Here is a link that might be helpful to you: http://support.microsoft.com/kb/316126

Thanks for the response, and yes, the article was helpful. I tried converting the original console app so I could change focus to the form - it still didn't work so I probably have some underlying issues that I need to research. Unfortunately, now the page isn't rendering correctly in IE so the whole WatIn thing is useless until I can resolve the display issues.
Mike K