분류 전체보기298 Excel ColumnWidth 변경 매크로 Sub Macro1()'' Macro1 Macro' 박상훈이(가) 2010-02-01에 기록한 매크로'' 바로 가기 키: Ctrl+k' Columns("A:X").Select Selection.ColumnWidth = 4End Sub 2010. 2. 1. StringGrid 셀 병합 및 표시방법 세팅 1. StringGrid Component Setting - DefaultDrawing = false; - FixedCols = 0; - FixedRows = 0; - LineColor = clBtnShadow; Canvas; ACanvas->Brush->Color = clWhite; ACanvas->Pen->Color = clBtnShadow; if (ACol%2) { CellRect = StringGrid->CellRect(ACol-1,ARow); Rect.Left = CellRect.Left; CellRect = StringGrid->CellRect(ACol,ARow); Rect.Right = CellRect.Right; if (ACol%4 == 1) ACanvas->Brush->Color = cl.. 2010. 1. 22. Excel 셀에 데이터 넣고 색을 바꾸는 방법 void __fastcall FillColorCell(int row, int col, int ColorIndex) { try { Variant cell, column, interior; cell = xlSheet.OlePropertyGet("Cells", row, col); column = cell.OlePropertyGet("Columns"); interior = column.OlePropertyGet("Interior"); interior.OlePropertySet("ColorIndex", ColorIndex); interior.OlePropertySet("Pattern", 1); //1 - xlSolid } catch(...) { } } 2010. 1. 19. Excel 설치 여부 확인 #include //..... Variant xlApp; try { xlApp = GetActiveOleObject("Excel.Application"); } catch(...) { ShowMessage("엑셀 프로그램이 없습니다."); } //..... 2010. 1. 19. Excel의 셀에 이미지 삽입 방법 아래 두 함수를 한번 살표 보세요 ExcelInsertImage SaveBitmapToExcel // Variant V; Variant excel_app; Variant excel_window; Variant excel_book; Variant my_worksheet; //---------------------------------------------------------------------------- void __fastcall TDLG_RPT_EXCEL::ExcelOpen() { excel_app=Variant::CreateObject("excel.application"); excel_app.OlePropertySet("Visible", (Variant)false); } //-----------.. 2010. 1. 19. Excel에서 특정 열의 타입을 지정해주는 방법 ref: http://www.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_qna&no=51088Excel은 너무 많은 기능이 있어서 그것을 익히기도 쉽지않은데.. 프로그램으로 직접 제어하는 기능까지 다 알기는 어렵죠 하지만 어떠한 특이한 기능이라도 찾는 방법이 있으니 .. 그것은 메크로 라는 것입니다. 1. 엑셀을 실행하고 2. 도구 => 메크로 =>새 메크로 실행 한후.. 3. 엑셀에서 원하는 기능을 수행하고. 4. 도구 => 메크로 => 메크로 정기 한후 5. 그 메크로의 내용을 그대로 코딩하면 됩니다. 특정 셀의 타입을 변경하는 방법을 메크로로 기록하니 아래와 같이 되더군요 //-----------------------------------.. 2010. 1. 19. Excel의 셀 범위를 ClipBoard로 Copy 하기 void __fastcall TForm1::Button1Click(TObject *Sender) { Variant xlApp, xlBooks, xlBook, xlSheets, xlSheet, vrange; xlApp = Variant::CreateObject("Excel.Application"); xlApp.OlePropertySet("Visible",true); xlBooks = xlApp.OlePropertyGet("Workbooks"); xlBooks.OleProcedure("Open", "C:\\TEST.xls"); xlBook = xlBooks.OlePropertyGet("Item", 1); xlSheets = xlBook.OlePropertyGet("Worksheets"); xlSheet = .. 2010. 1. 19. Excel의 Text ClipBoard format Excel에서 Text포멧의 경우 1) 라인(Line) 구분 CRLF로 하구요 2) 셀(Cell) 구분은 탭(Tab)으로 합니다. 즉 엑셀에서 Cell을 선택해서 Copy하면 ClipBoard에 Text포멧에는 위와같은 형식으로 들어갑니다. ClipBoard의 Text포멧의 내요을 가져와서 CRLF와 Tab으로 짤라서 Grid에 넣어주면 엑셀 to Grid 가 될것이구 반대로 Grid의 내용을 위와같은 포멧으로 만들어 Clipboard의 Text포멧으로 저장하면 엑셀에서 Ctrl+V할때 붙여넣기가 됩니다. 이것이 님께서 원하시는 Grid to 엑셀이 되겠네요 그럼.. 2010. 1. 19. .NET Compact Framework How-to Topics .NET Compact Framework How-to Topics http://msdn.microsoft.com/en-us/library/ms172482.aspx 2009. 12. 16. 이전 1 ··· 25 26 27 28 29 30 31 ··· 34 다음