Options

Excel Automation - Class of 'Range' MS Excel 14.0 Object Lib

DBGloverDBGlover Member Posts: 3
We are running NAV 2009 R2 Executables with 4.0 SP3 Objects. I am attempting to export a report to Excel and have a group of Cells in a Row Merged and Centered.
I am trying to use the 'Microsoft Excel 14.0 Object Library' with a Class of Range. I am receiving the following error message:
"This message is for C/AL programmers: Could not create an instance of the OLE control or Automation server identified by GUID={00020813-0000-0000-C000-000000000046} 1.7:{00020846-0000-0000-C000-000000000046}:'Microsoft Excel 14.0 Object Library'.Range. Check that the OLE control or Automation server is correctly installed and registered."
The rest of the Automation Classes from this Object Library I am using are working fine...... What am I missing? ](*,)
Thank You
Just for reference here is the code:

CREATE(XlRange);
MergedCells := XlRange.MergeCells(Cells);

Where XlRange is the Automation listed above.
Cells is a Code Concactenated Range of Excel Cells.
MergedCells is the Variable Parameter i am trying to end up with to pass to Excel.

Comments

  • Options
    SPost29SPost29 Member Posts: 148
    Hi,
    If you look at the excel buffer table, you will see that Range is not created.
    Only the XLApp is created
    IF NOT CREATE(XlApp,TRUE,TRUE) THEN
      ERROR(Text000);
    

    Range is always a part of something else like in the function CreateSheet
    XlWrkSht.Range(xlColID + xlRowID).Value := "Cell Value as Text"
    

    or in ReadSheet function
    XlRange := XlWrkSht.Range(GetExcelReference(5)).SpecialCells(11);
    

    In BorderAround function
    XlRange1 := XlWrkSht.Range(RangeName);
    XlRange1.BorderAround(1);
    

    I hope this helps
    Steve
Sign In or Register to comment.