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

Editing visibility of drawing object #970

Open
Ralim opened this issue Jul 27, 2021 · 0 comments
Open

Editing visibility of drawing object #970

Ralim opened this issue Jul 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Ralim
Copy link

Ralim commented Jul 27, 2021

Description

I have a xlsm file that contains drawing objects (buttons), and I would like to be able to edit the visibility of these.

I've been looking around and it looks like this library does not currently expose/parse these objects. (or I've totally missed it)

So I would love to get to a SetDrawingVisible similar to the SetRowVisible command.

Happy to code this if you have some pointers of how best to add this in.

I think it would be roughly:

  1. Somehow lookup the drawing xml file
  2. Create a reader for this file
  3. Walk the tree to find the drawing
  4. Edit
  5. Save changes

Obviously that feels simple and I've been poking around a bit but haven't yet put the concept together, so would love some pointers / if its trivial to do and I'm missing it feel free to tell me that :)

Describe the results you received:

Cant find anything in the existing API to let me edit these

Describe the results you expected:

Was really hoping for a SetDrawingVisible or similar :)

Output of go version:

go version go1.16.6 linux/amd64

Excelize version or commit ID:

f9e9e5d2e07b

Environment details (OS, Microsoft Excel™ version, physical, etc.):

** Example xml content I would like to be able to edit**

(Some data removed for simplicity)

    <xdr:oneCellAnchor>
        <xdr:from>
            <xdr:col>9</xdr:col>
            <xdr:colOff>62346</xdr:colOff>
            <xdr:row>11</xdr:row>
            <xdr:rowOff>106166</xdr:rowOff>
        </xdr:from>
        <xdr:pic macro="[0]!shtest.btn_Click">
            <xdr:nvPicPr>
                <xdr:cNvPr id="194" name="btn" hidden="1">
                    <a:extLst>
                        <a:ext uri="{FF2B5EF4-AAAA-BBBB-CCCC-F238E27FD236}">
                            <a16:creationId xmlns:a16="http:https://schemas.microsoft.com/office/drawing/2014/main" id="{E97E1194-C81D-BBBB-AAAA-3509A8EF5EF8}"/>
                        </a:ext>
                    </a:extLst>
                </xdr:cNvPr>
            </xdr:nvPicPr>
            <xdr:blipFill>
                <a:blip xmlns:r="http:https://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId1"/>
                <a:stretch>
                    <a:fillRect/>
                </a:stretch>
            </xdr:blipFill>
        </xdr:pic>
        <xdr:clientData fPrintsWithSheet="0"/>
    </xdr:oneCellAnchor>
@xuri xuri added the enhancement New feature or request label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants