|
우리 님이 쓰신 글 :
: 엑셀에서 값을 읽어서 화면에 보여주어야되는데요.
:
: 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();
|