엑셀 님이 쓰신 글 :
: 엑셀 파일(xls) Read / Write 기능을 엑셀 프로그램 설치 없이 직접 제어하는 코드입니다.
:
: 출처 : 코드프로젝트
http://www.codeproject.com/Articles/42504/ExcelFormat-Library
:
: * 첨부 파일
: - Excel_Format.zip : C++ Builder 2010에서 작성한 테스트 코드. (프로젝트 폴더에서 Lib 폴더 안에 파일 4개)
: - ExcelFormat_src.zip : 코드프로젝트에서 다운로드한 원본 소스.
:
:
:
: 하고 송신영님께서 답변을 얼마 전 엑셀에 대한 물음때 달아주셨는데
: 첨부파일을 풀어서 빌더로 켜보니 많은 4개의 cpp파일이 나오고
: 여러소스들이 많더라고요. 그런데 제가 필요로하는거는 엑셀 셀에 색을 입히는정도 끝이라
: 모든소스들을 사용하지 않아도될것같습니다. 그런데 더 중요한건 제가 빌더 초보라
: 첨부파일로 주신 소스들을 어떻게 가져와서 제가 만들고있는 프로그램에 적용시킬지 잘모르겠습니다.
:
: 혹시 제가 이해할수있게 간단하게 설명해주시면 감사하겠습니다!!! 감사합니다.
:
: 꾸벅꾸벅!
:
:
: //////////////////////////////////////
: Sub Macro1()
: '
: ' Macro1 Macro
: '
: ' 바로 가기 키: Ctrl+Shift+A
: '
: With Selection.Interior
: .Pattern = xlSolid
: .PatternColorIndex = xlAutomatic
: .Color = 65535
: .TintAndShade = 0
: .PatternTintAndShade = 0
: End With
: End Sub
: ////////////////////////////////////////
:
: 엑셀 매크로 소스를 가져와서 사용하면 될거같은데 적용이 잘안되네요.
:
:
: Variant cell, column, interior;
: cell = v1.OlePropertyGet("cells", 1, 1);
: column = cell.OlePropertyGet("Columns");
: interior = column.OlePropertyGet("Interior");
: interior.OlePropertySet("ColorIndex", 65535);
: interior.OlePropertySet("Pattern", 1); //1 - xlSolid
:
: 오류가납니다..
해결해씀돠 감사합니다~
vInter = v1.OlePropertyGet ("Cells", 1, 1). OlePropertyGet ("Interior");
vInter.OlePropertySet ("ColorIndex", 15);
vInter.OlePropertySet ("Pattern", 1);
vInter.OlePropertySet ("PatternColorIndex", -4105);