viernes, 23 de marzo de 2012 8:29
I am trying to make a model which heavily depends on data. For this reason i need to access an excel sheet to find the required data from the model program. The code has no error. However exploring the model gives an error.
"1 fatal execution failure: Method Microsoft.Office.Interop.Excel.ApplicationClass..ctor doesn't have an entry point.
Setting type "Microsoft.Office.Interop.Excel.ApplicationClass" to native with "Microsoft.Xrt.Runtime.NativeTypeAttribute" or in XRT.Config file might solve the problem. Spec Explorer 0 0 "
I cannot find a solution yet. help needed !!!
Todas las respuestas
viernes, 23 de marzo de 2012 13:26
Do you tried already adding this attribute to your model-namespace:
and replaced "Sample.MyLoader" with the method accessing the Excel-application-objects?
Replacing "Sample.MyLoader" with just the Excel-application-object should also work as mentioned in the error message...
Hope it helps.
A full example to reading external data is shown on the Spec Explorer Team Blog:
viernes, 23 de marzo de 2012 14:33
I have already tried that approach
assembly: Microsoft.Xrt.Runtime.NativeType("Microsoft.Office.Interop.Excel.ApplicationClass")] but it runs into another problem
Microsoft.Xrt.RecoverFromFatalErrorException: cannot retrieve generic definition of Microsoft.Office.Interop.Excel.Workbooks.OpenAny Suggestions!!!
viernes, 23 de marzo de 2012 16:39
my idea is that you made just
native, but not also
You can try to
* Add all classes you find in your error messages with the native attribute.
Or (I have this setup):
* Put all your Excel access methods into an own project (project "Helper").
* Add this project ("Helper") to your references and make only your own Helper class native.
Hope someone else has an even better solution for you.
lunes, 26 de marzo de 2012 5:21
It's very likely that Office Interop calls into native code which is not executable by Spec Explorer, so the direction that bububa suggested should be the way to go. You probably want to set all classes under Microsoft.Office.Interop.Excel to native. You can either do it following bububa's suggestion and creating a wrapper for all interop calls and set the wrapper class to native, or alternatively use a regular expression to set all all classes to native in a batch, like:
- Marcado como respuesta Vivek.Vishal lunes, 26 de marzo de 2012 8:58