Coder Social home page Coder Social logo

officedev / office-scripts-docs Goto Github PK

View Code? Open in Web Editor NEW
160.0 18.0 43.0 37.63 MB

Office Scripts Documentation

Home Page: https://learn.microsoft.com/office/dev/scripts

License: Creative Commons Attribution 4.0 International

PowerShell 100.00%
excel microsoft

office-scripts-docs's Introduction

Office Scripts documentation

Welcome to the Office Scripts documentation repository. In this repo, you can find the documentation source files for Office Scripts tutorials and how-to guides. For the best experience, we recommend you view this content on Microsoft Learn.

NOTE: You can find the reference documentation source files for the Office Scripts API in the office-scripts-docs-reference repository. These APIs contain all the potential operations for your scripts.

Give us your feedback

The goal of the repo is to provide developer education about Office Scripts. As such, issues should pertain to that educational content. Please submit an issue for the following scenarios:

  • Information needed to succeed in developing Office Scripts is missing or incomplete.
  • Information is inaccurate or obsolete.
  • You find typos, grammatical mistakes, or other problems with the articles.
  • Articles are organized in a confusing or unintuitive manner.

If you are seeing product behavior that differs from the documentation, please provide as much of the following information as is possible and relevant:

  • The version and build number of the client you are using.
  • Steps to reproduce the issue.
  • Console output and error messages.

We also encourage you to fork, make the fix, and do a pull request of your proposed changes. For details, see Contribute to this documentation.

If your issue is not related to the Office Scripts documentation, please post it to one of the following channels instead:

  • To ask a question about designing Office Scripts or the Office.js API that runs Office Scripts, post your question to Stack Overflow and tag it with the "office-scripts" tag.
  • To report an issue with the Office.js API, create the issue in the OfficeDev/office-js repository, which members of the product team monitor for customer-reported issues.

Copyright

Copyright (c) 2019 Microsoft Corporation. All rights reserved.

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-scripts-docs's People

Contributors

alexbuckgit avatar alexjerabek avatar alison-mk avatar benjaminehowe avatar dcthegeek avatar echolimitless avatar elizabethsamuel-msft avatar evanargelion avatar geoffren avatar gpresland avatar jayrathi avatar kbrandl avatar keyur32 avatar lindalu-msft avatar microsoft-github-policy-service[bot] avatar mikekinsman avatar mleach26 avatar nancy-wang avatar peronald avatar raprice avatar raulclouse avatar robinmeure avatar samantharamon avatar sumurthy avatar wamaina avatar wandyezj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office-scripts-docs's Issues

Code gives an error because of Argument Type

[20, 42] Argument of type 'string | number | boolean' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.


Document Details

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

Add section about undoing script runs

From @peronald:

I think we should show a user how to undo a script by going into the version history of the document. If a user runs a script and sees that they cannot undo it, they may have concerns. To alleviate their stress, we should probably include a section on how to 'undo' a script.

Define read and write operations?

Any workbook change is recorded as one or more write operations in the script. Scripts can also read data from a workbook.

What are read or write operations?

Tutorials page contains link to internal word doc

Under the prerequisites section "Opt-in to the Excel Scripting preview" this should include a walk through of how the IT admin can enable preview. It may also be worth including "Admin must opt-in to the Office Scripts preview" to match the necessary action.

Request for new article: Restoring Deleted Office Scripts

Could a new article be written on the topic of how to restore deleted scripts (from OneDrive)? This will be a good reference for support when customers accidentally delete or troubleshoot when they don't see a Script they expect in the available scripts.


Document Details

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

Issue with manually entering file path for .xlsx

Great tutorial! Got it working ok, struggled with adding my file path though - I could only add through using the pop-up file-selection GUI, instead of entering my filepath maunally (i.e. same path for example "/TestFolder/task-reminder.xlsx" but it failed on testing).


Document Details

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

Automate tab not visible in excel for web

We have officescripts enabled for users in our organization still no user can see automate ribbon in excel for web.

Article URL

https://docs.microsoft.com/en-us/office/dev/scripts/testing/platform-limits#third-party-cookies

Issue

We have office scripts enabled for users in our organization still no user can see automate ribbon in excel for web.

We checked with various browsers with all cookies enabled and in private session as well. All users in organization faces issue.
Is the feature available for yet to deliver. If feature is available then why automate ribbon is not available for our users.

Security of Office Scripts

Could you please offer more details concerning Office Scripts and Security? The statement "no JavaScript auth tokens can be shared with (office?) scripts" is a bit vague.


Document Details

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

Sharing Office Scripts in Excel for the web

see suggested correction in Issue section below

Article URL

https://support.microsoft.com/en-us/office/sharing-office-scripts-in-excel-for-the-web-226eddbc-3a44-4540-acfe-fccda3d1122b

Issue

Please be more precise for what access permissions this is true, "Important: Anyone with access to a workbook can view and run its attached scripts." Perhaps instead should read, "Anyone with Edit access to a workbook..." Users with Read access should be able to view the workbook but not be able to run scripts.

Consistently use `let` instead of `const`

Issue

From @gergzk:

One maybe minor thing that popped to my eye: the examples use a mix of let and const, and thinking about the feedback from MAKER, people might already find these confusing so having two of them could be worse?
The recorder intentionally creates lines of code with 'let' because it's not opinionated that these should be const and if someone wants to play with the code it's one less hurdle, but that's a pretty philosophical and unproven reason. Is there a consistency thing here we should be paying more attention to?

Safari supported..or not?

[Enter feedback here]
In conversation with Petra, my understanding is Safari is not supported due to disallowing 3rd party cookies by default. However Safari's inclusion here doesn't make that point clear, so if it is accurate that Safari is still not supported at present, then this should be stated and explained.


Document Details

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

Image

Hi,

How to insert an image from one sheet to another by script?
or
How to insert an image from the folder to the excel sheet by script?


Document Details

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

Steps 7-9 no longer up to date

image

[We now automatically save a script after a user stops recording. The script details pane contains options to rename a script (hover over script name or look in the ... menu) and update its description]


Document Details

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

Making a copy of an Office Script

Explain the concept of when and how to use “Make a Copy”.

Article URL

Either create a new, separate article or add to “Learn the basics of Office Scripts”
https://docs.microsoft.com/en-us/office/dev/scripts/tutorials/excel-tutorial

Issue

If you want to create a "template" script and later create independent copies of that template script, you must “Make a Copy” of the script. This is important to understand in the use scenario where you want to make a workbook “template” with multiple copies and customize each copy’s script.

How to transfer ownership for Office Scripts

A common scenario is how Office Script ownership transfer should be handled when the Office script creator is no longer with the organization or for any reason an ownership transfer of the Office Script is desired.

Article URL

Issue

Please describe in detail how ownership transfer can be performed by Office Script owners and tenant administrators. Include in the description what permissions are required, and whether it is possible to administratively transfer ownership from one user account to another. And is Modern M365 group ownership supported for Office Scripts? (If yes, please describe any transfer process relating to Group owned Scripts.)

Also describe default retention policy for Office Scripts after a user has left the organization and is deactivated in Azure Active Directory. Reference: https://docs.microsoft.com/en-us/onedrive/retention-and-deletion

Columns references

I can't find a solution for my macro:
function main(workbook: ExcelScript.Workbook) { let foglioVittorio = workbook.getWorksheet("Vittorio Zigiotto") let tabella = foglioVittorio.getTable("VittorioZigiotto") // Auto fill range tabella.addColumn() tabella.addColumn() tabella.addColumn() tabella.addColumn() tabella.addColumn() tabella.getRange(SOMETHING) .autoFill(SOMETHING, ExcelScript.AutoFillType.fillDefault);

I need to compile "SOMETHING" with the reference to the 5 columns before the 5 columns I added and to autofill the last 5 from that. Without table references it was:
function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); // Auto fill range selectedSheet.getRange("IC1:IG301") .autoFill("IC1:IL301", ExcelScript.AutoFillType.fillDefault); }

Document Details

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

Explanation for Ranges

In the section for Ranges (https://docs.microsoft.com/en-us/office/dev/scripts/develop/scripting-fundamentals#ranges)
It is explained that A1 notation refers to row A and column 1.
Shouldn't it be the contrary? The letter refers to column header and the number refers to row header.


Document Details

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

Code Editor and Record Actions

We finally enabled and got the automate ribbon in excel for web enabled however both Record Actions and Code Editor sub windows are not loading/are blank. Is the some additional setting than we need to install/enable?

Additional info: The help sub window does populate correctly, so not sure.

Missing The?

Original:

When the function is executed, Excel application invokes this main function by providing the workbook as its first parameter.

Proposed:

When the function is executed, the Excel application invokes this main function and provides the workbook as its first parameter.


Document Details

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

Make Description field a separate optional step?

The Description field can be used to provide context as to what the script does. You can leave the Description blank for the tutorial.

(Optional) Fill in the Description field so you can remember what the script does later.

Getting Data from Other Workbooks

I am not finding any documentation on how to get data from other Excel workbooks. I know this is possible with Google App Script, but it does not look I am finding anything about this with Office Script


Document Details

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

[LOC]Back-Translation "パワー自動化"→"Power Automate" (ja-jp)

ja-jp:"https://docs.microsoft.com/ja-jp/office/dev/scripts/develop/power-automate-integration"
power-automate-integration_j

en-us:"https://docs.microsoft.com/en-us/office/dev/scripts/develop/power-automate-integration"
power-automate-integration_e


Document Details

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

Use of getCount() => ??

Hello,

I failed to get the number of tables using getCount().
The workaround to get the number of items in the tableCollection is to use myTables.items.length


vAllSheetTables.load('items/length');
await context.sync();

console.log(vThisTable.name);
console.log(vAllSheetTables.items.length);


The only property available for the getCount() method is 'value' and I can't load it.
What's the syntax to use getCount() in order to read the number of items in the collection?

Thanks
Regards

David


Document Details

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

[LOC]Fixed inappropriate japanese "Power Automate Office"→"PowerAutomate を使用して Office" (ja-jp)

[LOC]Fixed inappropriate japanese "Power Automate Office スクリプトを実行する"→"PowerAutomate を使用して Office スクリプトを実行する" (ja-jp)

related:#257
ja-jp:"https://docs.microsoft.com/ja-jp/office/dev/scripts/develop/power-automate-integration"
power-automate-integration_j2


Document Details

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

Office Scripts in Excel on the web

Recommended add to existing article: Scripts are stored in the OneDrive /Documents/Office Scripts location of the Script owner. They are saved as .osts extension.

Article URL

https://docs.microsoft.com/en-us/office/dev/scripts/overview/excel

Issue

Notifying Office Script creators of the default location of Office script files will provide better visibility in locating and/or identifying the Office Script files in their OneDrive. There may also be administrative or security related reasons to be able to identify what .osts files are and where they are located by default.

Would be great if this page had a link to Sudhi's code samples on Github as well as other samples written by the community

[Enter feedback here]


Document Details

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

"Overview" missing top-level "what is this thing" section

When viewing the "Overview" page, I'm expecting to see a broad "what is this thing" section, followed by in-depth sections on what I need to know. Currently, I think the article does a good job with the in-depth sections, but omits a broader first section that is more detailed than the index, but less than the current sections.

E.g.

Overview

What can Office Scripts be used for?

Examples, gifs, motivate why this is awesome

Why is this useful?

Maybe case examples? Defer to Power Automate marketing approaches/docs framing

Who is Office Scripts meant for?

Brief overview of baseline skill sets required for certain things

How does Office Scripts work?

Outline the components and their general functions—current sections would probably be subsections here.

Article URL

https://github.com/OfficeDev/office-scripts-docs/blob/master/docs/overview/overview.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.