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

NET Core doesn't support SignedCms yet. #612

Open
kenzouno1 opened this issue Jan 21, 2020 · 0 comments
Open

NET Core doesn't support SignedCms yet. #612

kenzouno1 opened this issue Jan 21, 2020 · 0 comments

Comments

@kenzouno1
Copy link

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");
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant