- How To Use a Type Library for Office Automation from Visual C++ .NET(MSKB 307473)
- How To Automate Excel to Create And Format a New Workbook Using C++ .NET and MFC (MSKB 308292)
- How To Create Automation Project Using MFC and a Type Library (MSKB 178749)
- How To Use MFC to Create a Microsoft Excel Chart (MSKB 178783)
- How to Automate Excel and then know the user closed it (MSKB 192348)
- How To Automate Using VC++ to Save Excel Worksheet as HTML File (MSKB 199691)
- How To Embed and Automate an Excel Worksheet by Using C++ .NET and MFC (MSKB 311546)
- How To Automate Embedded Office ActiveX Documents with C++ .NET (MSKB 316587)
- How To Find and Use Office Object Model Documentation (MSKB 222101)
- Automating MS-Office applications
- Using MS Office in an MFC Application
- 2011년 일자 라이브러리(코드 프로젝트)
- Class to Start Microsoft Excel and Access Basic Excel Functions from a C++ Application(코드 구루)
Reading Excel files using ODBC(코드 구루)
가령 엑셀에서 1열은 A 2열->B, 3열->C .... 26열->Z, 27열->AA, 28열->AB 식으로 명명되어 있는데 숫자 28이라는 값을 넣었을때 AB라는 문자형 변환값을 구하는 함수입니다. BOOL NumericToExcelCol(__in int nNumericCol, __out TCHAR* pszColName)
{ if(!pszColName) return FALSE; //엑셀 2003 버전의 경우, 행의 최대 개수가 65536 개, 열은 256개 //엑셀 2007은 최대행이 1,048,576행이고, 최대열이 16,384열입니다 if(nNumericCol < 1 || nNumericCol > 256)//오피스 2003에서 최대 엑셀 컬럼 크기는 256, nNumericCol가 1에서 시작 return FALSE; nNumericCol -= 1;//컬럼이 1에서 시작하는 것으로 계산 _itot(nNumericCol, pszColName, 26); int nLen = _tcslen(pszColName); for(int nLoop = 0; nLoop < nLen; nLoop++) { if(pszColName[nLoop] >= _T('0') && pszColName[nLoop] <= _T('9')) pszColName[nLoop] += 17; else pszColName[nLoop] -= 22; if(nLoop != (nLen - 1)) pszColName[nLoop] -= 1; } return TRUE; } |
엑셀 오토메이션을 하다보면 열의 숫자 좌표를 영문으로 바꿔야 할때가 있습니다.
'C & C++ > C & C++' 카테고리의 다른 글
[API] 프로세스 관리 02 (0) | 2011.11.24 |
---|---|
[API] 프로세스 관리 01 (0) | 2011.11.24 |
도스명령어(command) 얻기 (0) | 2011.11.17 |
현재 메모리 정보 얻어오기 (0) | 2011.11.17 |
윈도우 부팅모드 알아내기 (0) | 2011.11.17 |
댓글