C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[44057] Re:excel 과 clipboard
0 [] 1741 읽음    2006-03-10 22:10
우리 님이 쓰신 글 :
: 엑셀에서 값을 읽어서 화면에 보여주어야되는데요.
:
: col : 7
: row : 3000
:
: 정도 됩니다.
:
: 그래서 일반적으로
:
: ExcelWorksheet->Cells->get_Item((TVariant)i, (TVariant)1);
:
: 이런식으로 for 루프를 3000번 돌려서 읽어들이면 시간이 무지 오래 걸리더라구요 ㅡㅡ;;; 한 20초 이상..
:
: 그래서 클립보드에 복사해서 읽으면 빠르다는 것 같아서요..
:
: 그런데 어떻게 해야할지 막막합니다. ㅠ.ㅠ
:
: 고수님들 돋와주세용~

   xlApp = Variant::CreateObject("Excel.Application");
   xlApp.OlePropertySet("DisplayAlerts", false);
   xlApp.OlePropertySet("Visible", false);
   xlBooks = xlApp.OlePropertyGet("Workbooks");
   xlBook = xlBooks.OleFunction("Open","Book1.xls");
   xlSheets = xlBook.OlePropertyGet("Worksheets");

   xlBook.OleFunction("Activate");
   xlSheet = xlSheets.OlePropertyGet("Item", 1);
   xlSheet.OleFunction("Activate");
   xlRange = xlSheet.OlePropertyGet("Range",xlSheet.OlePropertyGet("Cells",1,1),xlSheet.OlePropertyGet("Cells",4,3));
   xlRange.OleFunction("Select");
   xlRange.OleFunction("Copy");
  /*
   xlSheetDest =  xlSheets.OlePropertyGet("Item", 2);
   xlSheetDest.OleFunction("Activate");
   xlRangeDest = xlSheetDest.OlePropertyGet("Range",xlSheetDest.OlePropertyGet("Cells",1,1),xlSheetDest.OlePropertyGet("Cells",1,2));
   xlRangeDest.OleFunction("Select");
   xlSheetDest.OleFunction("Paste");
  */

   Memo1->PasteFromClipboard();

+ -

관련 글 리스트
44056 excel 과 clipboard 우리 1011 2006/03/10
44057     Re:excel 과 clipboard 0 1741 2006/03/10
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.