octscorpion

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            0 Posts :: 17 Stories :: 0 Comments :: 0 Trackbacks
            public static void excelPrint(String filePath) {
                  ActiveXComponent xl 
          = new ActiveXComponent("Excel.Application");
                  
          try {

                      Dispatch.put(xl, 
          "Visible"new Variant(false));
                      Dispatch workbooks 
          = xl.getProperty("Workbooks").toDispatch();
                      Dispatch ex 
          = Dispatch.call(workbooks, "Open", filePath).toDispatch();
                      Dispatch.get(ex, 
          "PrintOut");
                  }
           catch (Exception e) {
                      e.printStackTrace();
                  }
           finally {
                      xl.invoke(
          "Quit"new Variant[] {});
                      xl 
          = null;

                  }


              }
          posted on 2012-12-12 17:38 一G刀客 閱讀(295) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 郁南县| 永福县| 巴南区| 辉县市| 堆龙德庆县| 米易县| 尚义县| 江山市| 百色市| 拉孜县| 普定县| 元阳县| 资阳市| 巴马| 华阴市| 措勤县| 阜南县| 缙云县| 阳曲县| 昆明市| 龙海市| 香港 | 冷水江市| 固镇县| 盐山县| 炉霍县| 永嘉县| 房产| 揭西县| 九台市| 彰化市| 佛山市| 泰和县| 壤塘县| 兴海县| 兴城市| 漯河市| 通城县| 峨眉山市| 若羌县| 铜山县|