Excel export exception

Using C # .net I export data from tags in my form to succeed. The code is as follows:

Excel.Font font = range.Font; font.Color =Color.Black; 

When using this code, I get an exception

"Methods with System.Color parameters or a return type cannot be called via IDispatch."

Please help me solve this problem.

+4
source share
1 answer

I believe that you will find the answer in the following thread: http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6a25be14-fc4f-40c6-aaea-62cb76140cd1/

Quick response:

  font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Black) 
+3
source

Source: https://habr.com/ru/post/1369633/


All Articles