Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a workbook Example not working #1276

Closed
Djone124 opened this issue Sep 1, 2019 · 4 comments
Closed

Create a workbook Example not working #1276

Djone124 opened this issue Sep 1, 2019 · 4 comments
Assignees
Labels
Area: Excel Feedback on Excel content Status: fixed Fix is complete and will be available to customers as soon as doc updates are published Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken)

Comments

@Djone124
Copy link

Djone124 commented Sep 1, 2019

Could not get the example provided in the section Create a workbook with a Base64 example to function. It is saying the property result does not exist for "event.target". The code is being run in Script Lab.

Screen Shot 2019-09-01 at 12 08 05 AM


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@ghost ghost added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Sep 1, 2019
@kbrandl kbrandl added Area: Excel Feedback on Excel content Needs: attention 👋 Waiting on Microsoft to provide feedback Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken) and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Sep 2, 2019
@kbrandl
Copy link
Contributor

kbrandl commented Sep 2, 2019

@Djone124 sorry to hear that you've run into this problem. @AlexJerabek is this something that you can investigate? Thanks!

@AlexJerabek AlexJerabek removed the Needs: attention 👋 Waiting on Microsoft to provide feedback label Sep 3, 2019
@AlexJerabek
Copy link
Collaborator

Hi @Djone124 ,

Thanks for reporting this. If you're using Script Lab, there's a full TypeScript example for this scenario in Script Lab's samples. You'll see there's some casting to get this to cleanly compile, but the JavaScript should work anyway. Try that out and let me know if there are still problems.

That said, I should clean up the JavaScript in this sample. The type of event.target is ambiguous. According to this comment, we'll get the same behavior by calling reader.result.toString(). I'll update the code in both the docs and Script Lab to do that and avoid the need to cast.

As for the compilation error for myFile.files[0], you'll have to cast it in TypeScript. We do that in the Script Lab sample, but can't really the in the JS sample.

I'm going to open PRs in this repo and office-js-snippets for the code changes described above. Please let me know if you're able to get the sample working in Script Lab.

@AlexJerabek AlexJerabek added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Sep 3, 2019
@Djone124
Copy link
Author

Djone124 commented Sep 3, 2019 via email

@ghost ghost added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Sep 3, 2019
@AlexJerabek
Copy link
Collaborator

Hi Danny,
I'm glad everything's working. I'm going to go ahead and close the issue, as the doc changes are in the pipeline. If you encounter any other problems while developing your add-in, please reply to the thread or create a new issue.
Thanks!

@AlexJerabek AlexJerabek added Status: fixed Fix is complete and will be available to customers as soon as doc updates are published and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Excel Feedback on Excel content Status: fixed Fix is complete and will be available to customers as soon as doc updates are published Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken)
Projects
None yet
Development

No branches or pull requests

3 participants