Skip to content
This repository was archived by the owner on Mar 9, 2020. It is now read-only.

NET Core doesn't support SignedCms yet. #612

@kenzouno1

Description

@kenzouno1

I want to use VBA Project in net core 2.2 but it throws error NET Core doesn't support SignedCms yet.

###Mycode

            ExcelPackage pck = new ExcelPackage();
            var sheet = pck.Workbook.Worksheets.Add("DANH SACH KHACH HANG");
            
            var code = "Private Sub Worksheet_Change(ByVal Target As Range) \n"+
            "Code by Sumit Bansal from https://trumpexcel.com\n"+
            " To allow multiple selections in a Drop Down List in Excel (without repetition)\n"+
            "Dim Oldvalue As String\n" +
                "Dim Newvalue As String\n" +
                "Application.EnableEvents = True\n" +
                "On Error GoTo Exitsub\n" +
                "If Target.Address = \"$C$2\" Then\n" +
                "If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then\n" +
                "GoTo Exitsub\n" +
                "Else: If Target.Value = \"\" Then GoTo Exitsub Else\n" +
                "Application.EnableEvents = False\n" +
                "Newvalue = Target.Value\n" +
                "Application.Undo\n" +
                "Oldvalue = Target.Value\n" +
                "If Oldvalue = \"\" Then\n" +
                "Target.Value = Newvalue\n" +
                "Else\n" +
                "If InStr(1, Oldvalue, Newvalue) = 0 Then\n" +
                "Target.Value = Oldvalue & \", \" & Newvalue\n" +
                "Else:\n" +
                "Target.Value = Oldvalue\n" +
                "End If\n" +
                "End If\n" +
                "End If\n" +
                "End If\n" +
                "Application.EnableEvents = True\n" +
                "Exitsub:\n" +
                "Application.EnableEvents = True\n" +
                "End Sub";
            pck.Workbook.CreateVBAProject();
            sheet.CodeModule.Code = code;

  return File(pck.GetAsByteArray(), "application/vnd.ms-excel.sheet.macroEnabled.12",
                $@"Mau-Nhap-Ds-Khach-Hang-{DateTime.Now.ToShortDateString()}.xlsm");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions