zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
449 stars 86 forks source link

Can not call member of Excel interop object #76

Closed cuiliang closed 4 years ago

cuiliang commented 4 years ago

I am using Microsoft.Office.Interop.Excel to work with excel. When I pass a Workbook object to the expression, there will be NullReference exception.

image

JonathanMagnan commented 4 years ago

Hello @cuiliang ,

Do you think you could provide us a runnable example with this error?

It will make easier for my developer to get started.

Looking at this online example, it should be something that we could be able to support: https://dotnetfiddle.net/NBPqHU

Best Regards,

Jon

cuiliang commented 4 years ago

TestExcelInterop.zip

Please try this project. You must have Microsoft excel running before run this sample.

thankyou.

JonathanMagnan commented 4 years ago

Hello @cuiliang ,

Thank you for the project.

The v4.0.2 has been released.

Could you try it and let us know if we now support Marshal object like the one you are using correctly?

Best Regards,

Jon

cuiliang commented 4 years ago

@JonathanMagnan It's working now. Thank you! Great job!