C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[40217] DB그리드이 내용을 엑셀로 변환할때 에러가 납니다.
아름이 [] 1158 읽음    2005-05-18 19:09
Variant xlApp, xlBooks, xlBook, xlSheet, xlSheets, VRange;

    if (xlApp.IsEmpty()){
        xlApp=Variant::CreateObject("Excel.Application.9");
    }

    xlApp.OlePropertySet("Visible", true);

    xlBooks=xlApp.OlePropertyGet("Workbooks");
    xlBooks.OleProcedure("add");
    xlBook=xlBooks.OlePropertyGet("Item",1);
    xlSheets=xlBook.OlePropertyGet("Worksheets");
    xlSheet=xlSheets.OlePropertyGet("Item",1);

   //아래의 내용은 엑셀로 잘 옮겨집니다. 문제가 전혀없이요..

    VRange=xlSheet.OlePropertyGet("Range","A1");
    VRange.OlePropertySet("Value", "날짜");
    VRange=xlSheet.OlePropertyGet("Range","B1");
    VRange.OlePropertySet("Value", "성명");    


//그런데 이부분은 에러가 나네요
   AnsiString a, b, date, name;
   date = "2005-01-01";
   name = "홍길동";

   a = "A" + 2;
   a=""+a+"";

   VRange=xlSheet.OlePropertyGet("Range",a);
   VRange.OlePropertySet("Value",date);


   b = "B" + 2;
   b=""+b+"";

   VRange=xlSheet.OlePropertyGet("Range",b);
   VRange.OlePropertySet("Value",name);

컴파일시는 문제가 전혀 없구요
실행해서 엑셀로 변환할때 "잘못된 변수 유형입니다" 라고 에러가 나면서

그 포인터가 sysvari.h 의

template <class P1>
  Variant Variant::OlePropertyGet(const String& name, P1 p1)
  {
    TAutoArgs<1> args;
    args[1] = p1;
    return OlePropertyGet(name, static_cast<TAutoArgsBase*>(&args));  <--- 이부분에서 잡힙니다.
  }


무슨 에러며 왜 나는것일까요?

고수닙들의 한수 가르침을 간절히 기다립니다. 꾸벅

+ -

관련 글 리스트
40217 DB그리드이 내용을 엑셀로 변환할때 에러가 납니다. 아름이 1158 2005/05/18
40223     Re:DB그리드이 내용을 엑셀로 변환할때 에러가 납니다. 마방진 1154 2005/05/19
40228         Re:Re:DB그리드이 내용을 엑셀로 변환할때 에러가 납니다. 아름이 861 2005/05/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.