Problems scrolling in Excel Online with Selenium - excel

I'm running a test to verify the contents of a file in Office 365. The file is a .xlsx file. I can open the file in excel online and verify the contents of the spreadsheet up to a point - unfortunately it's a large file and I need to scroll down to make more data visible. I've tried the following:
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("window.scrollBy(0,1200)", "");
and
driver.findElement(By.xpath("XPATH")).sendKeys(Keys.PAGE_DOWN);
but neither seem to do anything. Can anyone suggest something else? Is there a way I can drag the scroll bar downwards?
EDIT:
Browser is Firefox.
I should have been more clear about the 'file' - it's an attachment which is uploaded to an Outlook group in Office365. I open it simply by clicking on a link. This then opens in Excel Online which displays as a frame on top of the normal Outlook screen.
By using:
Browser.getTopBrowser(driver);
driver.switchTo().frame("CollabOfficeDocumentBody");
driver.findElement(By.xpath("class"));
I can find the contents of individual cells, but only to a certain point (54 rows down I think).
I'm not sure if this answers your questions...

Related

How to open an Excel Online document as a PDF

We have an Excel Online file that I'd like to link to, but as a pdf. In other words, I want a link that opens the contents of the Excel Online file as a PDF file. Ideally, admin users would be able to edit the excel file, then end-users would be able to open the PDF version of that file, as it is continuously updated by the admin users. Is this possible? I would need a link to the PDF version of the file.
I did come across this thread, but the answer isn't actually answering the question. https://superuser.com/questions/1133384/is-it-possible-to-link-or-sync-an-excel-spreadsheet-with-a-pdf
Based on your response above I believe the following may accomplish what you want.
What you will need to do is enable the Developer Tab in Excel so we can create Macros. We will be creating a Macro that will Save the excel file as a PDF. My assumption is that there is one worksheet in the excel file. When you enable the macros, and save the first time it you will need to save it as a xlsm file to save the macros with the file. Once you do this perform the following below.
In Onedrive create a new folder and call it "MyPubDocs" for example.
In Excel open up your online Xlsm file and do a SaveAs
In the file dialog Box navigate to the Onedrive folder you created and take note of the folder name. It might show...
Web Sites > https://d.docs.live.net > > MyPubDocs
Click on the header bar and copy the URL and save it.
In Excel go to the developer Tab, if you don't see then go to File Menu -> Options -> Customize RIbbons -> Popular Commands (left) and Main Tabs (right) and check the Developer checkbox. click OK.
Click on Macro Button Set the Macro name to "SaveToOneDrive" ad click create.
That should open a IDE where you will paste the following command.
ActiveWorkbook.SaveAs Filename:="https://d.docs.live.net/XXXXXXXXXXXXXX/MyPubDocs/" & "MyExcelFileExportAsPDF.Pdf"
When creating the macro you should be able to assign a hotkey to that macro.
Now whenever the admin finishes saving the excel file, they can press the hotkey or run the macro and it will save the file to the location.
If you want to associate the macro to the save event of the workbook, you can, but auto save should be turned off.
After the first time you saved the pdf, go to onedirve and navigate to the pdf file. Create a sharable link that you can distribute to your users. When they navigate to that sharable link it should show them the most recent pdf.
HTH

How to open second tab of excel file when linked from powerpoint file

I have an Excel 2013 document in .xlsx format having 3 separated tabs. When I open the excel file by double-clicking, I see the first tab opening by default, which is supposed.
I am linking the excel file on MS PowerPoint. However, here I want the second tab comes to the screen by default, but the first page comes.
In short, I want to see the first tab of the excel file when I open it by double-clicking, but want to see the second page when I open the excel file via the link in the PowerPoint. I couldn't find a way to manage it. Any help would be appreciated.
Thanks.

Excel Connections - Edit Links Not Working?

I do not know if this has been asked elsewhere but I looked and googled around for 30 mins and couldn't seem to find much. I have an old file with some drop down boxes for certain cells in an excel spreadsheet. I never really know how it works to be honest, and there are no macros within this sheet. But somehow, there are some links between some cells within the same file.
I recently changed file names and made copies to this master file, but some of the newer copies drop down boxes no longer work, and seems to be wanting to get to the original file. I tried editing this/these link(s) under the ribbon interface using 2016 - Data > Edit Links (under connections), and it brings up a pretty dialogue box, which has this change source button. But after I clicked it and selected the correct file (it's a circular reference, so it is the current file), it simply did nothing and did not update the file name or anything else shown within the dialogue box. And of course, my links are not fixed and the drop down boxes are not working.
I have uploaded the file here with all data stripped out, but the links are still intact there for your review. Any suggestions why I am seeing this? If I want to fix the links, what can I do to achieve that without fixing each of the cells individually? Thanks!
The file is here:
https://drive.google.com/open?id=1Sn27jnQmYvqWHho6Oa0yz7PXVGU4zwPJ
These reason you're seeing these links is that there are cells with Data Validation that point to an external file (cell B71, for example).
Remove all Data Validation that is referencing external files, save the file, and re-open. The links should be gone.

Export to Excel, open, enable editing and all the formulas change

I have an important spreadsheet I have created using Google Docs. This is over many tabs pulling numbers into the first tab. It all works well in Google Spreadsheets but I need to download it.
When I download it as Excel and open it it shows OK but asks me to enable editing / saving. As soon as I do this the data changes on the sheet and all my formulas are screwed.
Can anyone help?
I am new to this so I hope I have posted in the correct area :)
Do you already own excel ?
To export a Google Sheets file to Excel, open the Sheet, go to File > Download As and select .xlsx.

Excel workbook not responding

I am using Excel 2010 and am having difficulty with one old workbook created in Excel 2003. Lots of symptoms to report!
No other workbooks are giving me this problem. This problem file usually causes "MS Excel - (workbook name.xls) [Compatibility Mode] (Not responding) and a blank screen apart from the task bar and this Excel message on a single line across the top of the screen. Waiting doesn't solve the problem. If I close Excel and choose the "Close program" option, it sometimes shows me the file as I remember it for a couple of seconds, then the program closes. Re-opening the file just gives the same behaviour again. During the first few seconds of loading, I can see the message "Contacting server for information" at the bottom of the Excel screen.
In Task Manager I can find EXCEL.EXE *32 running. I'm using Windows 7 Pro 64 bit.
This is a file I use regularly in projects as a specialised calculator, and so I re-copy it each time and save it to save the calculation records in the project file. I've found that versions of the workbook created even several years ago and have given no trouble until now all suffer this problem, so it looks like a problem with Excel 2010. This is the first time I've tried to open these files since migrating from a Win XP computer running Excel 2003.
Please can anyone help me to open the file and to resolve the problem?
Thanks
There might be a calculation or a marcro activated on start up that messes things up.
Try the following:
Open the Excel application, with a blank workbook. Set calculation to manual. Now look up your Macro settings and set these to "disable with notifications".
With these things set, open your misbehaving workbook again and see what happens now. Dont let the macros (if any) start yet! Open the VBA Editor window and check for a script in Workbook called Workbook_Open. If that is present check its content or put a break in and debug it.
Let us know what you find, if any.
UPDATE:
It sounds like there is a database link to an external source that is trying to refresh on startup but isnt working correctly (anymore). I now remember likewise behaviour when I had an Excel workbook with tons of SQL queries in it that (in case of showing a complete table or view by applying SELECT * FROM ...) could overlap other data and that would create autoshutdowns for me. Change the option in the Trust Center for External Content to Disable when you open this workbook and let us know!
I have a client with the same issue. The problem was resolved by removing all the logo's (Images) from the sheet. It appears that the logo contains a link to some web site. I copied the logo into paint and copied it back.
Problem Solved!
It appears that an object placed in the sheet can have its own links embedded in it???
I hope this helps!

Resources