OLE error (exporting to excel)

Hi All,

We have this error message when trying to export to excel from customized analysis form. The form just summarizes the amount in value entry per dimension based on the date filter specified.

An exception was raised in method Range.

The OLE control or Automation server has returned error (HRESULT) -2147352567.

I tried to run the debugger and don’t know if this will help to identify the problem:

XlWrkSht.Name := SheetName;

IF ReportHeader <> ‘’ THEN

XlWrkSht.PageSetup.LeftHeader :=

STRSUBSTNO(’%1%2%1%3%4’,GetExcelReference(1),ReportHeader,CRLF,CompanyName);

XlWrkSht.PageSetup.RightHeader :=

STRSUBSTNO(Text006,GetExcelReference(2),GetExcelReference(3),CRLF,UserID2);

XlWrkSht.PageSetup.Orientation := XlLandscape;

IF FIND(’-’) THEN BEGIN

REPEAT

RecNo := RecNo + 1;

Window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));

IF NumberFormat <> ‘’ THEN

XlWrkSht.Range(xlColID + xlRowID).NumberFormat := NumberFormat;

IF Formula = ‘’ THEN

XlWrkSht.Range(xlColID + xlRowID).Value := “Cell Value as Text”

Can anyone help us on this error message?

Thanks :),

Lee

Hi Lee,

Which version of NAV you are using ?

When you turned on debugger, on which line debugger showed error ?

Regards

Bheem

Hi ,

You need a developer assigned to this , its a customised code . Needs debugging.

The error you you mention could be anything …

g.