Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FactoryException: Class does not exist: NetOffice.OfficeApi. #289

Open
jozefizso opened this issue Aug 20, 2020 · 3 comments
Open

FactoryException: Class does not exist: NetOffice.OfficeApi. #289

jozefizso opened this issue Aug 20, 2020 · 3 comments
Milestone

Comments

@jozefizso
Copy link
Member

NetOffice library may report invalid class name in the FactoryException thrown from CreateObjectFromComProxy() method.

The Class does not exist: NetOffice.OfficeApi. should end with the class name of the component for which the instance could not be created and the classType is null.

throw new FactoryException("Class does not exist: " + (true == String.IsNullOrWhiteSpace(fullClassName) ? ComTypes.TypeDescriptor.GetFullComponentClassName(comProxy) : fullClassName));

Invalid class name is created in the GetFullComponentClassName() method:

public static string GetFullComponentClassName(object component)

@jozefizso jozefizso added this to the 1.7.x milestone Aug 20, 2020
@jozefizso
Copy link
Member Author

Stack trace:

NetOffice.Exceptions.FactoryException: Class does not exist: NetOffice.OfficeApi.
  Module "NetOffice.Core", in CreateObjectFromComProxy
  Module "NetOffice.Core", in CreateObjectFromComProxy
  Module "NetOffice.Utils", in GetProxyEnumeratorAsProperty
  Module "NetOffice.OfficeApi.DocumentProperties", in GetEnumerator
  Module "System.Linq.Enumerable", in First

@Offbeatmammal
Copy link

intermittently seeing the same issue, curious if there are any suggested workarounds or planned fix?

NetOffice.Exceptions.FactoryException
  HResult=0x80131500
  Message=Class does not exist: NetOffice.PowerPointApi.
  Source=NetOffice
  StackTrace:
   at NetOffice.Core.CreateObjectFromComProxy(IFactoryInfo factoryInfo, ICOMObject caller, Object comProxy, Type 
comProxyType, String className, String fullClassName, Boolean allowDynamicObject)
   at NetOffice.Core.CreateObjectFromComProxy(ICOMObject caller, Object comProxy, Boolean allowDynamicObject)
   at NetOffice.Utils.<GetProxyEnumeratorAsProperty>d__13.MoveNext()
   at NetOffice.PowerPointApi.Shapes.<GetEnumerator>d__121.MoveNext()

@IainDM
Copy link

IainDM commented Jun 10, 2022

Also seeing this intermittently. StackTrace below from an enumeration over a sheet's CustomProperties

NetOffice.Exceptions.FactoryException: Class does not exist: NetOffice.ExcelApi.
at NetOffice.Core.CreateObjectFromComProxy(NetOffice.IFactoryInfo factoryInfo, NetOffice.ICOMObject caller, System.Object comProxy, System.Type comProxyType, System.String className, System.String fullClassName, System.Boolean allowDynamicObject) at offset 348
at NetOffice.Core.CreateObjectFromComProxy(NetOffice.ICOMObject caller, System.Object comProxy, System.Boolean allowDynamicObject) at offset 227
at NetOffice.Utils.d__13.MoveNext() at offset 353
at NetOffice.ExcelApi.CustomProperties.d__26.MoveNext() at offset 101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants