Inserting new rows and moving exsisting ones with OpenXML SDK 2.0

后端 未结 2 536
天命终不由人
天命终不由人 2020-12-30 12:53

I\'m using OpenXML SDK 2.0 to add data to the spreadsheet template but I ran into a problem (since I\'ve been using OpenXML for a day that\'s not so hard to believe). I can\

2条回答
  •  离开以前
    2020-12-30 13:34

    Thanks amurra for the answer. For those who still cannot make it Here are the missing pieces

    /// 
    /// Given a cell name, parses the specified cell to get the column name.
    /// 
    /// Address of the cell (ie. B2)
    /// Column name (ie. A2)
    private static string GetColumnName(string cellName)
    {
        // Create a regular expression to match the column name portion of the cell name.
        Regex regex = new Regex("[A-Za-z]+");
        Match match = regex.Match(cellName);
    
        return match.Value;
    }
    public enum CellReferencePartEnum
    {
        None,
        Column,
        Row,
        Both
    }
        private static List Letters = new List() { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ' };
    

提交回复
热议问题