void KTL_CPeng_ImportCustStamp() 

    str                 file; 
    FileNameFilter      filter = ["@SYS57521",'*.xlsx', "@SYS101541",'*.xls']; 
    COMVariant          COMVariant1; 
    SysExcelApplication app; 
    SysExcelWorkbooks   Workbooks; 
    SysExcelWorkbook    Workbook; 
    SysExcelWorksheets  Worksheets; 
    SysExcelWorksheet   Worksheet; 
    SysExcelCells       Cells; 
    SysExcelCell        RCell1, RCell2, RCell3,RCell4,RCell5,RCell6,RCell7, RCell8; 
    int                 i, j; 
    #excel 
    ; 
 
    try 
    { 
        ttsbegin; 
        file        = Winapi::getOpenFileName(, filter, '', "Open Excel Files"); 
        app         = SysExcelApplication::construct(); 
        Workbooks   = app.Workbooks(); 
        COMVariant1 = new COMVariant(); 
        COMVariant1.bStr(file); 
        Workbook    = Workbooks.Add(COMVariant1); 
        Worksheets  = Workbook.worksheets(); 
        Worksheet = Worksheets.itemFromName("sheet1"); 
        //Worksheet   = worksheets.itemFromNum(1); 
        Cells       = Worksheet.Cells(); 
 
        i = ; // first line is a title, start line 2 
        RCell1 = Cells.Item(i, ); 
        RCell2 = Cells.Item(i, ); 
        RCell3 = Cells.Item(i, ); 
        RCell4 = Cells.Item(i, ); 
        RCell5 = Cells.Item(i, ); 
        RCell6 = Cells.Item(i, ); 
        RCell7 = Cells.Item(i, ); 
        RCell8 = Cells.Item(i, ); 
 
        while (RCell1.value().bStr() != "") 
        { 
            print Cells.item(i, ).value().bStr(); 
            // add code 
            i++; 
            RCell1 = Cells.item(i, ); 
            RCell2 = Cells.Item(i, ); 
            RCell3 = Cells.Item(i, ); 
            RCell4 = Cells.Item(i, ); 
            RCell5 = Cells.Item(i, ); 
            RCell6 = Cells.Item(i, ); 
            RCell7 = Cells.Item(i, ); 
            RCell8 = Cells.Item(i, ); 
        } 
        ttscommit; 
 
        info(strfmt("%1 %2 %3", "Update Complete", i-, curext())); 
    } 
    catch 
    { 
        info("Nothing Uploaded"); 
    } 
}

AX_SysExcel的更多相关文章

随机推荐

  1. 如何将maven依赖项打进jar包,将一个完整的项目打进jar包

    目的:我的目的就是将项目所有的文件,包括pom文件中依赖的jar包都打进一个jar包里面. 过程:将下面的内容放到pom文件里面. </dependencies> <build> ...

  2. [转][C#]文件流读取

    { internal static class FileUtils { public static string GetRelativePath(string absPath, string base ...

  3. Linux下部署 apache+jdk+tomcat

    1.输入下面的命令安装apache2: ubuntu@VM-164-86-ubuntu:sudo apt-get install apache2 当提示“您希望继续执行吗?”时  输入 Y 然后等待安 ...

  4. [ExcelHome]15个常用的Excel函数公式,拿来即用

    微软最有价值专家(MVP)祝洪忠分享15个模式化的表格公式,大家有类似问题可以直接套用. 首先声明,我这个可称不上是什么公式大全,就是给各位新人朋友们入门学习的,高手请按返回键. 1.查找重复内容 = ...

  5. 杂谈3.py

    bin() --------十转二 hex()------- 十转十六 oct()-------十转八 import math math.floor(数值)返回小于等于数值的整数 math.trunc ...

  6. 分布式之redis复习精讲

    看到一片不错的精简的redis文档,转载之,便于复习梳理之用 转自:https://www.cnblogs.com/rjzheng/p/9096228.html ------------------- ...

  7. python——字符串问题总结

    转义符r/R使用: print (r'\n') print (R'\n') 输出: \n \n 不受转义符\n影响 python字符串格式化: print ("我叫 %s 今年 %d 岁!& ...

  8. Eclipse 安装中文简体语言包

    Installing the language packs Open the install wizard with 'Help' > 'Install new software...' Add ...

  9. BASEDIR

    1)正常写python程序会有一个可执行的bin.py文件,假如这个文件需要导入my_module里面定义的模块,应该怎么设置sys.path(此时可以直接导入), 因为bin和model属于同级目录 ...

  10. 从一个简单的约束看规范性的SQL脚本对数据库运维的影响

    之前提到了约束的一些特点,看起来也没什么大不了的问题,http://www.cnblogs.com/wy123/p/7350265.html以下以实际生产运维中遇到的一个问题来说明规范的重要性. 如下 ...