This project has moved. For the latest updates, please go here.

Error using BuiltinDocumentProperties

Dec 15, 2011 at 8:42 PM

I used BuiltinDocumentProperties as follows:

Workbook wb = xlApp.ActiveWorkbook;

    if (wb != null)      {        COMObject DocumentProperties = wb.BuiltinDocumentProperties;      }

This causes the following error:

LateBindingApi.Core.LateBindingApiException was unhandled  Message=class 2df8d04c-5bfa-101b-bde5-00aa0044de52:DocumentProperties not found in loaded LateBindingApi AssembliesCurrently loaded LateBindingApi AssembliesLoaded LateBindingApi Assembly:00020813-0000-0000-c000-000000000046 ExcelApi, Version=, Culture=neutral, PublicKeyToken=b1d22616f2ea9ad3
  Source=LateBindingApi.Core  StackTrace:       at LateBindingApi.Core.Factory.GetFactoryInfo(Object comProxy)       at LateBindingApi.Core.Factory.CreateObjectFromComProxy(COMObject caller, Object comProxy)       at NetOffice.ExcelApi._Workbook.get_BuiltinDocumentProperties()  InnerException: 

Any ideas?


Dec 16, 2011 at 3:45 AM

hello there,

can you tell me your NetOffice release version?
the CLR loads reference assemblies on demand and NetOffice works with loaded assemblies, thats the basic problem behind.

the problem is as follows: DocumentProperties is defined in OfficeApi.dll, you dont use any office type in your code module and
thats the reason for the CLR dont load the officeapi.dll and the latebinding.core.factory can't find the corresponding wrapper type in loaded assemblies.
NetOffice 1.3 includes a new AdHoc Load mechanism in the Initialize() method there have to call at start to avoid the problem.
what you can do is upate to NetOffice 1.3 or use a office type in your module.

if (wb != null)      {        Office.DocumentProperties DocumentProperties = wb.BuiltinDocumentProperties as Office.DocumentProperties;      }



Dec 16, 2011 at 3:10 PM

You are right: I didn't use the latest version.

Both solutions do work.

Thank you