Language/C#

    엑셀 - Sheet 생성 과 Sheet 이름 바꾸기

    Colored By Color Scripter™12345678910111213141516171819202122 /* 함수명 AddSheet * 입력인자 : 원하는 이름의 Sheet 추가 * Sheet에 마지막에 원하는 Sheet가 추가된다. */ public void AddSheet(string sheet_name) { int totalSheets = xlApp.ActiveWorkbook.Sheets.Count; xlWorkSheet = (Excel.Worksheet)this.xlApp.Worksheets.Add(); xlWorkSheet.Name = sheet_name; ((Excel.Worksheet)xlApp.ActiveSheet).Move(misValue, this.xlApp.Worksheets[..

    엑셀파일 생성 및 저장

    Colored By Color Scripter™123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace ExcelTest{ class Program { static void Main(string[] args) { ExcelMod..

    [오류] 'Microsoft.ACE.OLEDB.12.0' 공급자는 로컬 컴퓨터에 등록할 수 없습니다.

    참조에 위 Microsoft Excel 14.0 Object Library 를 추가하고 빌드를 하면 개발PC에서는 실행이 잘되지만오피스가 설치되지 않은 다른 PC에서는 오류가 발생한다. [오류] 'Microsoft.ACE.OLEDB.12.0' 공급자는 로컬 컴퓨터에 등록할 수 없습니다. 라는 오류 발생시 다음주소의 설치파일을 다운로드하여 설치해주면 된다. http://www.microsoft.com/ko-kr/download/details.aspx?id=13255 나의 경우 64Bit PC여서 64Bit용으로 받아서 설치해주었다. 물론 Build시에도 AnyPC또는 64Bit용으로 빌드를 해주었다. 출처 : http://blog.naver.com/goldrushing?Redirect=Log&logNo=1..

    Excel 다루기 (Microsoft Excel 14.0 Object Library) - 1

    솔루션 탐색기에서 프로젝트 이름을 마우스 오른쪽 단추로 클릭참조 추가를 클릭합니다. 참조 추가 대화 상자가 나타납니다.Microsoft Excel 14.0 Object Library를 찾아서 참조 !!!그럼 일단 준비 끝 !!!

    하위 디렉토리 경로 내 파일 목록 얻어오기

    Colored By Color Scripter™1234567891011121314151617181920212223 try { foreach (string dir in Directory.GetDirectories(path)) { foreach (string file in Directory.GetFiles(dir, filetype)) { Console.Write(file); } SearchDirectory(dir, filetype); } } catch (System.Exception excpt) { Console.WriteLine(excpt.Message); } }

    partial class

    닷넷 2.0 부터 추가된 기능이다. 이 기능을 사용하면 팀원 간 프로젝트를 진행하는 경우 클래스를 개별 파일로 분할하여 작업할 수 있기 때문에, 동시에 대규모 프로젝트 진행하는 경우 작업 수행이 용이하다. 예를 들어 아래와 같다. Colored By Color Scripter™12345678910111213141516171819202122232425262728293031323334353637A.cs public partial class PartialExample{ public string A() { return "A"; }} B.cspublic partial class PartialExample{ public string B() { return "B"; }} C.cspublic partial class ..