Switching Office Javascript APIs to Preview on Yeoman Office Generated project - excel

I am trying to access the Office Javascript Preview APIs on my Angular Yeoman Generated project. I am writing this Office add-in on a Mac in Visual Studio Code. I wrote code on Script Lab with the preview library but do not know how to do the same for the Yeoman generated Office project. When I try to access the ".addFromBase64()" function, I get:
"Property 'addFromBase64' does not exist on type 'WorksheetCollection'.ts(2339)"
I have already tried changing the CDN references from Javascript 1.8 APIs
to the Javascript Beta (Preview) APIs and added the #types suggested by the note next to the section. I found and replaced 2 instances of the 1.8 APIs in 'commands.html' and 'taskpane.html'.
I have tried the steps for Updating an Office Add-in project created with a text editor or other IDE.

In case anyone else besides Daniel and me ever wants to know this:
As described here, in addition to changing the CDN referernces and adding the preview #types, you need to uninstall the production #types with
npm uninstall --save-dev #types/office-js

We confirmed the addFromBase64 should works in MAC from https://appsforoffice.microsoft.com/lib/beta/hosted/excel-win32-16.00.debug.js
Please clear cache and try again to see if works.

Related

Excel add-in Shared runtime configuration, webpack.config.js is not present in project

I created an Excel Add-in project few months back using Visual Studio 2019. Now I am facing some issues and came to conclusion that Shared Runtime might not be configured correctly. So I followed this tutorial to update manifest of the project.
https://learn.microsoft.com/en-us/office/dev/add-ins/tutorials/share-data-and-events-between-custom-functions-and-the-task-pane-tutorial
However after that It is mention to update webpack.config.js, but this file is not present in project. Even if I create a new project using VS2019, this file is not there. Can anyone guide me how to add this file like its location, contents etc so that I can add it and follow next steps to configure Shared Runtime correctly.
You need to use the VSCode with yeoman generator to scaffold an add-in project which uses webpack for bundling. For example, the Build an Excel task pane add-in page contains guides for Visual Studio and Yeoman generator (as a rule VSCode or WebStorm developers).
Reply from Rick Kirkham on Github page is below.
https://github.com/OfficeDev/office-js-docs-pr/issues/3568#issuecomment-1201573455
This tutorial creates an add-in project with Yo Office. That kind of
project runs in Node.js. WebPack is a tool for bundling multiple
JavaScript files into one. WebPack is only relevant to Node.js based
projects. Since you created your project in VS 2019, your project uses
C# or VB.NET on the server side and runs in an IIS server. WebPack is
not used in that environment. That's why there is no webpack.config.js
file. Whatever problems you are having with the shared runtime, you're
not going to solve it with WebPack.
Consider raising your problem on Microsoft Q&A. Be sure to
"office-addin-dev".
Alternatively, consider recreating your project as a Node.js project.
You can use this tutorial as a good place to start.

Universal Windows Plateform And Live SDK

I have a problem. I recently installed VS 2015 and Windows 10 on my computer.
Having Universal Apps are amazing and I plan to convert some of my programs on UWP.
But I have a problem. In one of my programs, I allow the user to save its datas on its OneDrive. And if OneDrive is unavailable, the datas are stored on local devices.
And when OneDrive is available, the newly stored datas are pushed to OneDrive. Synchronisation in fact.
So it is the problem. In the UWP dll named Universal.Live I have installed Live SDK 6 with Nuget. During the package installation, there is some work done to see if the Live SDK is compatible with UWP.
Great ! It's compatible and successfully installed.
But when I wrote
using Microsoft.Live;
The name is not recognized. And if I use the class LiveAuthClient which is in the namespace, it isn't recognized too...
This is a real problem :( Any ideas ?
I had the same issue adding the Live SDK to my app. For some reason the Package.JSON isn't correctly resolving and downloading the package (or recognizing it).
Either way, just add the DLL to your references the old fashioned way. Personally, I'd just add it to a console app (not using the new Project.json package), get it from NUGET, and grab the DLL from the Packages.
After you have the DLL:
Right click on References
Add Reference -> Browse...
Find the DLL and add it. ("...\\packages[LiveSdk]...")
It works!
Download it from here, Compile it, and grab the desktop SDK:
https://github.com/liveservices/LiveSDK-for-Windows
You can also download the msi, install it, figure out where the DLL is installed to and grab it from there:
https://www.microsoft.com/en-us/download/details.aspx?id=42552
According to this GitHub issue, LiveSDK isn't supposed to be used for Universal Windows Platform apps: https://github.com/liveservices/LiveSDK-for-Windows/issues/58
Instead we should use these SDKs that cover the same functionality:
Mail/Calendar/Contacts: https://dev.outlook.com/
Files/OneDrive: https://dev.onedrive.com/

I can't create a new node.js project with webstorm 9.0.1

I just installed the webstorm 9.0.1 trial windows version, and when I try to create a new project in the project type list I don't see any reference to node.js applications.
I see in all the documentation that node.js project template is supported.
I'm missing something?
thanks,
Luca
I know this is a bit late, but perhaps the boilerplate samples were removed from 9.01? I'm showing the same thing and came across this post regarding version 8 -
Webstorm IDE missing Node.js Boilerplate Project type
EDIT :
And omg, the issue was I didn't scroll down :) I don't see the boilerplate app referenced in the above link, but there is an Express seed app.
NodeJS project types missing in WebStorm
If you don't see any reference to Node.js, then you're most likely missing the plugin.
Go to File > Settings > Plugins and check if NodeJS is visible and checked. If it's not there, select Browse repositories, select NodeJS and Install plugin and restart your IDE.

Different version of VS2012 requires project migration?

I have a project that was created using VS2102 Premium. When a co-worker tries to open it with VS2012 Professional he gets a "Needs migration" message for the project. Is this due to the different flavor of VS2012?
I wouldn't have thought so for most projects, however if you've used some feature of VS Premium that is not present in VS Professional, then I guess this is the response you'll get.
If you open a project from a previous version (eg 2010) then it'll offer to upgrade the solution.
You can manually edit the project, its only an XML file. Create a new blank project to see the structure and then use winmerge or similar to copy relevant lines across.

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

Resources