简体   繁体   English

类&#39;Range&#39;的COM对象中的方法&#39;value&#39;返回错误代码0x800A03EC( <unknown> ) 意思是: <unknown> 。 AX 2012

[英]Method 'value' in COM object of class 'Range' returned error code 0x800A03EC (<unknown>) which means: <unknown>. AX 2012

I am importing from excel sheet into AX. 我正在从Excel工作表导入AX。 So the process: Go through records from excel and add them to temp table and populate in grid. 流程如下:浏览excel中的记录,并将它们添加到temp表中,并填充到网格中。 This is the process happening. 这是正在发生的过程。 When i use less records ex: 1400 records, its importing into grid without issues. 当我使用较少的记录,例如:1400条记录时,它可以毫无问题地导入网格。 When I am importing 66000 records, it's throwing this above error. 当我导入66000条记录时,它抛出了以上错误。 Can someone suggest what should i do such that I can import 60000 records at a time? 有人可以建议我怎么做才能一次导入60000条记录吗? I tried restarting AX, creating new excel sheet which are suggested online..... Nothing worked. 我尝试重新启动AX,创建了在线建议的新Excel表。

Yes, when develop any import Excel had this problem, when many rows. 是的,在开发任何导入Excel时都会出现此问题,当有很多行。 If there are few rows it works perfect. 如果行数很少,则效果很好。

For this cases always change the excel import for CSV import. 对于这种情况,请始终将excel导入更改为CSV导入。 The code to import csv file never fail and work great. 导入csv文件的代码永远不会失败,并且效果很好。

Here I leave an example to import a csv file with 3 rows. 在这里,我留下一个示例来导入具有3行的csv文件。

Code: 码:

static void Stack(Args _args)
{
    AsciiIo               asciiIo;
    container             con;
    FileIoPermission      perm;    
    boolean               _CortarProceso;
    IO_Status             aa;    
    str                   filename;
    str                   _row1, _row2, _row3;            

    Dialog                dialog;
    DialogField           dialogFileName;

    ;

    dialog         = new Dialog("Select CSV File");
    dialogFileName = dialog.addField(ExtendedTypeStr("FilenameOpen"),"Path File:");

    if (dialog.run())
    {
        filename = dialogFileName.value();
    }

    if (!filename)
    {
        return;
    }

    perm = new FileIoPermission(filename, "R");
    perm.assert();
    asciiIo = new AsciiIo(filename, "R");
    asciiIo.inFieldDelimiter(";");

    if (asciiIo != null)
    {
          con = asciiIo.read();
          while((asciiIo.status() == IO_Status::Ok) && (!_CortarProceso)){                          
              _Row1          = conPeek(con, 1); //Row1
              _Row2          = conPeek(con, 2); //Row2
              _Row3          = conPeek(con, 3); //Row3

              if(_row1 != ""){
                  //Your Code...      
                  //Your Code...
                  //Your Code...
                  //Your Code...
                  //Your Code...
              }else{
                  _CortarProceso = true;
              }                        
              con = asciiIo.read();
          }

    }

    info("Process End");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM