问题
I have managed to create a fully functioning task pane add-in for Excel 2013 using Visual Studio Pro 2013 and I have a bunch of test functions that all work nicely, like adding in data, creating bindings, creating tables etc. Now I want to do something that is very simple in Excel, which is add in a new column, then copy the column to the left of it into the new column. In excel this would copy all of the formula and any cell formulas references that are relational would transpose nicely to the new column. (E.g =A1 might become =B1) Is there any way of doing this using javascript? The only alternative I can think of is to add in the new column as a blank column and the rebuild all the information and formulas from scratch in javascript, then add the formatting, which is an extremely long winded alternative for something that Excel does so well with a simple copy and paste (special) thanks Stu
回答1:
Thanks for posting your question here. Unfortunately, copy and special paste is not available yet. But we are aware of the importance of this API and we are investigating into it. I am afraid while we are looking into this, you will have to rebuild the column with JavaScript. But make sure check out dev.office.com and office developer blogs as we are actively working on adding more APIs to Excel.
If you have any other API requests, you can submit them on officespdev.uservoice.com.
Thanks, Sky
来源:https://stackoverflow.com/questions/31960093/is-it-possible-to-copy-excel-formula-using-an-office-add-in