Certification Failure because of missing Document.getFileAsync in Excel Desktop - ms-office

We have an Excel 365 Add-In, which is using Document.getFileAsync (because it is the only way to access the complete spreadsheet, without requiring the user to select it).
This API is not available in Desktop Excel (neither 2013 nor 2016).
How we are supposed to handle the MS complaint on Office Store certification, that the App is not running in Desktop Excel?
Is it enough to include
<Requirements>
<Sets>
<Set Name="File" />
</Sets>
<Methods>
<Method Name="Document.getFileAsync" />
</Methods>
</Requirements>
in the manifest?
Testing shows that Excel is ignoring this options (at least when the manifest is coming form a local folder).
Or are we supposed to implement a second code path (with a different UI), that requires the user to select the complete spreadsheet, so that we can export it via getDataAsync for Desktop Excel?
How can find out, if we are embedded in Excel Desktop or Excel Online?

You seem to have a typo in your manifest, it should read
<Method Name="Document.getFileAsync" />
And not
<Method Name="Doument.getFileAsync" />
In any case, I'd encourage you to take a look at Worksheet.GetUsedRange, which allows you to retrieve the range that encompass all the data of a worksheet as in the following sample :
var ctx = new Excel.RequestContext();
var sheetUsedRange = ctx.workbook.worksheets.getActiveWorksheet().getUsedRange();
sheetUsedRange.load('values');
ctx.sync().then(function() {
console.log(sheetUsedRange.values);
});
Now, to answer your question on how to know whether you're embedded in Excel Desktop or Excel online, I'd suggest looking a Michael Zlatkovsky's answer on that matter.
Gabriel Royer
Developer on the Office Extensibility Team, MSFT

Related

JavaScript API does not work for Excel 2013?

I just got a change recommendation report for one add-in I submitted. It says Your add-in is not working in the Excel 2013 client on Windows 7 with Internet Explorer 11.
I have always been testing my add-in in Excel 2016 and Excel Online. So I just installed Excel 2013 (version 15.0.4841.1000, which includes SP1), indeed the add-in does not work. But it seems that few things work...
For example, the following example function writes haha in Cell A1 under Excel Online, whereas, it does not anything in Excel 2013.
function test () {
Excel.run(function (ctx) {
var range = ctx.workbook.worksheets.getItem("Sheet1").getRange("A1");
range.values = [["haha"]];
return ctx.sync();
});
}
So does anyone know if JavaScript API supports Excel 2013? If not, many professionals will not be able to use add-ins because they are still with Excel 2013...
PS: I see there are lots of add-ins in office store require Excel 2013 or later or Excel 2013 Service Pack 1 or later. If JavaScript API does not support Excel 2013, how have these add-ins (eg, Stock Connector) been developed?
Edit 1: In my manifest xml:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
In my Home.html, I have:
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
Edit 2: I guess the following setting is equivalent to say the add-in is not supposed to be used in Excel 2013?
<Hosts>
<Host Name="Workbook" />
</Hosts>
<Requirements>
<Sets>
<Set Name="ExcelApi" MinVersion="1.2"/>
</Sets>
</Requirements>
<DefaultSettings>
...
</DefaultSettings>
When you use the Office.js APIs, you will see that each method is annotated with an API set designation. For example:
These API sets correspond to what versions of Office the add-in will work on. The list of requirement sets, and where they're supported, can be found at http://dev.office.com/reference/add-ins/office-add-in-requirement-sets.
Any of the new Office 2016 host-specific API sets (ExcelApi, WordApi, etc.) are only supported on Excel 2016+ (and Office Online and Mac/iOS equivalents). The API version number (1.1 vs. 1.2 vs. 1.3) corresponds to updates to the APIs, that were added past the RTM build of Office 2016 (which shipped with 1.1 out-of-the-box). Those updates are available to customers who have an Office 365 subscription (home or business). Customers who bought a disk/MSI product of Office 2016 will only have the original 1.1 APIs.
You can use the requirement sets in two ways. If your add-in 100% depends on a particular API set, you should list it in your manifest file. That way, the add-in won't even be proffered on the "Insert/Manage Add-ins" dialog for Office versions that don't support that particular API set.
On the other hand, if you're only using a few APIs in the set, and could do without (even if it's a bit of a degraded experience), you can do the "light-up scenario". That is, you will list the lowest possible version that you do need, and then use a runtime check to detect whether a particular API set is available.
Concrete example: suppose you have an Excel Add-in that creates a new sheet and outputs data into a table. This requires ExcelApi 1.1 version or higher. Ideally you would also like to be able to set the column widths, but range.format.columnWidth is only available in ExcelApi 1.2. You don't want to block customers from using your Add-in if they have an old version -- after all, the bulk of your functionality will still work, even if not optimally -- but you do want to make use of the new APIs. In that case, you should specify ExcelApi 1.1 in your manifest, and then do a runtime check in you JavaScript to determine if you can run the range.format.columnWidth code. I.e.:
if (Office.context.requirements.isSetSupported("ExcelApi", 1.2 )
{
range.format.columnWidth = 25;
}
For a related answer, see Neat ways to get environment (i.e. Office version)
Excel 2013 supports some things, but there's lots that it doesn't support, including anything using Excel.run().
http://dev.office.com/reference/add-ins/office-add-in-requirement-sets

Get objects / functions from SAP BEx (Business Explorer) Analyzer Excel add-in

I work with an Excel add-in called SAP BEx Analyzer (BExAnalyzer.xla).
Unfortunately, the documentation of this add-in seems very incomplete and it's a pain to work with it.
I would like to know if there is a way to inspect such an add-in to see what objects/methods/function and so on it contains?
Many thanks!
In the current release of SAP Business Explorer (based on 7.30), the BExAnalyzer.xla file is unprotected so you are able to inspect it.
If you wish to delve deeper in to the BEx object model, it is worth adding a reference in your VBA Project to the two type libraries (BExAddin.tlb and BExApi.tlb) in the Business Explorer installation folder (usually located in \Program Files (x86)\SAP\Business Explorer\BI\).
I'm actually in the exact same boat with BEx. I haven't found any official documentation but a hefty amount of google fu gets me by. I've also had some luck pressing F2 in the code window when you have the SAPBEX.xla module selected and then picking the SAPBEX library in the first drop down. It will give you all the methods/functions/constants in the library which isn't documented well at all either but you can make some educated guesses and trial and error...if you have the spare time.

Require sharepoint 2010 search tool

I am migrating MOSS 2007 site to sharepoint 2010 without UI upgrade. In MOSS 2007, to search a specific keyword from the document uploaded on site we use to use "http://sharepointsearchserv.codeplex.com/" tool. The result use to be in xml format. And I would fetch the filename of the document from the xml,Now that I am migrating it to 2010 I require a new tool. Hence I came across this: http://fastforsharepoint.codeplex.com/. But this tool can search only till 10000 records. For next 10000 records it produces below error.
<ResponsePacket xmlns="urn:Microsoft.Search.Response">
<Response domain="">
<Status>ERROR_SERVER</Status>
<DebugErrorMessage>System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]</DebugErrorMessage>
</Response>
</ResponsePacket>"
My query is. Is there any alternate tool which I can use?
I suspect the problem is not with the tool itself, but with the search service.
Check the USL logs to find the cause of the error.
I referred http://www.silver-it.com/node/97 link to solve the issue. But speaking about the tool. When I say "save result" it stops working. And when I click on "save all results" it just saves the code. I want to save the result as xml file. How do i do that?

Exporting data to existing Excel file

I have a system with an Excel spreadsheet template file which is used for invoicing. I would like the user to be able to click a button on an Xpage, which will then open the spreadsheet and enter the latest invoicing data in Excel. I don't mind if Excel is either the application on their machine or on the server, but my preference would be the application locally on their machine.
I've looked into Xagents, as I feel this is probably the answer. I know they can be used to create Excel but I have not been able to locate any mention of opening an Excel file, and entering data into specific cells.
Is this possible?
EDIT: you can use Apache POI for editing and creating Microsoft Office documents. This is a java project which gives you a handle to office documents and this can be used using java.
A good starting point can be the blog of Christian Guedemann from webgate:
http://guedebyte.wordpress.com/2012/09/17/documents-and-spreadsheets-with-xpages-building-the-kernel-part-ii/
(end of edit)
The only way I KNOW and tried to write data from Notes to Excel is exporting the data to an HTML page and setting the Content Type accordingly (e. g. as described here (there are a lot more resources available for taht):
http://www.dominoguru.com/pages/developer2010_xpagexlsexport.html
I am not sure if this is of help but it seems that this project can help you:
http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=ZK%20Spreadsheet%20for%20XPages
As far as I can see this project can load Excel files from XPages - and then it should also be possible to edit the files.
Besides that the only solution I can think of is a Notes Agent that is called from the XPage. This agent can then run in background and do all the excel stuff. After running, the XPage can show a link to the Excel file. Actually this is the solution I would consider to implement - but maybe others step in with better answers here.
You don't want to introduce a dependency on Excel in your application -- wouldn't work with an iPad front-end. Rather have a look at the ZK Spreadsheet, it will fulfill your needs.
However if you have to have Excel, then you need a roundtrip solution: load the Excel from an URL (probably generated by an XAgent (?) and save it back. The saving back part is the tricky one. Normal HTTP doesn't allow that. What you need there is a webDAV capable server. Watch out for a project on OpenNTF soon (just clearing IBM legal) that provides webDAV.
However the ZK Spreadsheet looks much better for your needs.
I have a sample database at the following URL --> http://www.nnsu.com/nnsusite.nsf/%24%24OpenDominoDocument.xsp?documentId=B65507CB2DE15B3286257986005F061D&action=openDocument
Download the APCC.nsf. This will allow you to create/read a new EXCEL spreadsheet and then stream the resulting file to the requesting browser. There is not need to have EXCEL or office installed on the Server.
THe examples create a new workbook, but you can also store a "template" on the server or in a notes document and use it as a starting point and then save it to a document or stream it to the requesting browser.
With Apache POI you can read/write to a spreadsheet using data from the notes document the process is initiated from.

Excel Expert: need a good solution to fill some data into a complex excel sheet

I am stuck with a problem
The Requirement is that, there a complex Excel file(XLS) that is used as template; it has Macros and all the worksheets are either locked or hidden. When the user clicks to download it, the follows operation occurs
Unlock a particular worksheet, fill some data # certain cells and then lock it back.
Unhide a worksheet, fill some data # certain cells and then hide it back.
I think there are two options to resolve it (if there are more then please let me know)
Interop libraries / Excel Object Library
OLEDb Driver
I cannot got with the option 1 as excel is not installed on the webserver and I heard that it's not a good option to install MSOffice # webserver.
My question is that can we use OLDb to perform the operations mentioned above OR is there any other option ???
BTW Sharepoint service is also not available :(
Please help!!!!
You could maybe try ExcelPackge.
See this article:
Server-Side Creation of Excel 2007 Files Using .NET 3.0 and Office Open XML
see also:
Office Space - Building Office Open XML Files
Check out this question I asked some time ago for an overview of options. I ended up going with the Aspose library, which I link to in my original post. It's not cheap, but it does the job very simply and elegantly. It even has templating functionality built in (called SmartMarkers, IIRC).
SpreadsheetGear for .NET will handle this and has an API which is very similar to Excel. You can see what our customers say and download the free, fully functional evalution here.

Resources