Problem on using Excel automation in C/AL

Cem_KaraerCem_Karaer Member Posts: 281
Here is the problem: I try to extract data from an Excel sheet by using Excel automation objects, namely Excel application object, worksheet object and range object. But when I encounter an empty cell on the sheet, value property of the range object returns nothing!! C/AL doesn't even execute an assignment statement. How can I handle this? I tried to find if there is any way to check that the return value is null, empty or something like it, I found no function for this.
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Answers

  • krikikriki Member, Moderator Posts: 9,118
    Check T370:"Excel Buffer". This table has some code in it to import/export data from/to Excel.
    Maybe you can use this to receive the information from Excel. Or maybe in the code in the table, you can find how to do it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SaalekSaalek Member Posts: 181
    Hi

    The problem is that Navision doesn't accept NULL values.
    Try using Variant variables.

    Variant1 := Excell......
    Thne, use Variant variable function to know wath type of data is

    if variant1.ISINTEGER THEN
    begin
    end;
    if variant1.ISTEXT then
    begin
    end;

    I had similar problen reading access databases and that was my problem solution

    Bye
  • Cem_KaraerCem_Karaer Member Posts: 281
    Thank you for your help.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
Sign In or Register to comment.