Coder Social home page Coder Social logo

Comments (4)

Zlatkovsky avatar Zlatkovsky commented on August 10, 2024

@kevishi , could you please take a look?

from office-js.

sumurthy avatar sumurthy commented on August 10, 2024

Hi @FelipeCostaGualberto, in this scenario, what would you expect the right behavior to be?

We don't yet support get selected table/chart/or other objects.

We did add getActiveCell API in the newer release (still in beta). https://github.com/OfficeDev/office-js-docs/blob/ExcelJs_OpenSpec/reference/excel/workbook.md#getactivecell

Would that help?

from office-js.

FelipeCostaGualberto avatar FelipeCostaGualberto commented on August 10, 2024

I need a macro to easily color the background of my selection, be it a Range or a TextBox. VBA demonstration:

Sub ColorSelection()
    Const FILL_COLOR = 6299648
    
    Select Case TypeName(Selection)
        Case "Range"
            Selection.Interior.Color = FILL_COLOR
        Case "TextBox"
            Selection.ShapeRange.Fill.ForeColor.RGB = FILL_COLOR
        Case Else
            MsgBox "Can't color this type of object: " & TypeName(Selection)
    End Select
End Sub

from office-js.

JuaneloJuanelo avatar JuaneloJuanelo commented on August 10, 2024

Probably this is a by design issue. The name of the method is getSelectedRange

Now that we are implementing shapes, charts, etc we should consider adding a generic "getSelection()" and let the user infer whats contained. This is actively on design.

we understand the requirement, so closing the issue at this point.

from office-js.

Related Issues (20)

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.