i am trying open xls file and convert to pdf using web api 2 service. When i start service project in vs 2013 everyting works fine, but when i publish the service to iis 8.0 and try to open excel file i got error:
Error:
Exception has been thrown by the target of an invocation. at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at NetOffice.Invoker.MethodReturn(COMObject comObject, String name, Object[] paramsArray)
Error on this line:
var workbook = excelApplication.Workbooks.Open(excelLocalOutput, 0, false, 5, 123, 123, true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
What i tryied to solve this:
i gave "Network Service" and "IUSRS" permission to Microsoft Excel Application
i gave "Network Service" to application pool
i gave "Network Service" to published folder