How to check if .net interoperability for excel is installed

后端 未结 3 1223
傲寒
傲寒 2021-01-27 23:48

I am using .net Primary Interoperability Assembly for Excel in my code. But, the application can be run on machine which doesn\'t have .net PIA for Excel installed. I want to gi

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-28 00:06

    I guess System.Type.GetTypeFromProgID("Excel.Application",true); method will throw exception if Excel is not present. You can use a try catch block and verify.

提交回复
热议问题