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
[5653] Re:Re:한꼬맹이님~~~help
시빌더 [] 2873 읽음    2001-02-22 16:24
한꼬맹이 님이 쓰신 글 :
: 시빌더 님이 쓰신 글 :
: : 답변고맙습니다..
: : 그코드는 자동생성코드가 맞아요..
: : 근데
: : ActiveForm이 아닐경우에는 문제가 없는데..
: : ActiveForm에만 Excel을 연결만 하면 그코드에서 break 가 걸리거든요?
: : 에러메세지를 보니 뭐.. Excel_Tlb와 애매모호한 코드이다..(대충 해석) 이런것 같은데..
: : 다른코드는 손덴게 없어요..
: : 갑갑하군요..
: : 읽어주셔서 대단히 감사합니다..
:
: 안녕하십니까?
:
: 한꼬맹이 입니다.
:
: 엑셀을 불러오는 코드를 저한테 한번 보여주시고 정확한 에러코드도 보여주시면
:
: 고맙겠네요...
:
: 지금은 소스를 보지않은 이상 뭐라고 말씀드릴수가 없네요
:
: 그럼 참고하시길...
:
:

답변고맙습니다..

***** excel 연결및 query data를 엑셀로...(cpp파일)

#include <vcl.h>
#pragma hdrstop
#include <atl\atlvcl.h>
#include "Serv_TLB.h"
#include "L1_cliImpl1.h"
#include "Excel_TLB.h"
#include <UtilCls.h>


void __fastcall TL1_cli::BitBtn5Click(TObject *Sender)
{
   Variant xlApp, xlBooks, xlBook, xlSheets, xlSheet,VCell;
   try
   {
       xlApp = CreateOleObject("Excel.Application.9");
   }
   catch (Exception &exception)
   {
        ShowMessage("Excel이 설치되어 있지 않습니다.");
        return;
   }

   if ( SaveDialog->Execute() == false )
         return;

   if ( FileExists(SaveDialog->FileName) )
   {
       ShowMessage("파일이 존재함.");
       return;
   }

    xlApp.OlePropertySet("DisplayAlerts", false);
    xlApp.OlePropertySet("Visible", false);
    xlBooks = xlApp.OlePropertyGet("Workbooks");
    xlBooks.OleProcedure("Add");
    xlBook = xlBooks.OlePropertyGet("Item", 1);
    xlSheets = xlBook.OlePropertyGet("Worksheets");
    xlSheet = xlSheets.OlePropertyGet("Item", 1);

    xlSheet.OlePropertySet("Name", String("자료1")  );

    Integer i;

    LPum01->First();
    AnsiString str1,str2;

  for (i = 1;i<=LPum01->RecordCount;i++){

     VCell = xlSheet.OlePropertyGet("Cells", i, 1);
     VCell.OlePropertySet("Value",LPum01->FieldByName("PumCode")->AsString);

     VCell = xlSheet.OlePropertyGet("Cells", i, 2);
     VCell.OlePropertySet("Value",LPum01->FieldByName("PumName")->AsString);
     LPum01->Next();

     }

    xlBook.OleProcedure("SaveAs", SaveDialog->FileName);
    xlBook.OleProcedure("Close");
    xlApp.OleProcedure("Quit");
}

그리고.. 에러가 나는 코드입니다..(자동생성코드입니다.. ActivexForm)

STDMETHODIMP TL1_cliImpl::_set_Font(IFontDisp** Value)   ****>이부분
{
  try
  {
    const DISPID dispid = -512;
    if (FireOnRequestEdit(dispid) == S_FALSE)
      return S_FALSE;
    SetVclCtlProp(m_VclCtl->Font, Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IL1_cli);
  }
  return S_OK;
};

***에러메세지 : E2105 Ambiguity between 'IFontDisp' and 'Excel_tlb::IFontDisp'.

이상입니다..
바쁘실텐데 많은 도움 주셔서 대단히 감사합니다..

+ -

관련 글 리스트
5642 한꼬맹이님~~~help 시빌더 2676 2001/02/22
5650     Re:한꼬맹이님~~~help 한꼬맹이 2986 2001/02/22
5653         Re:Re:한꼬맹이님~~~help 시빌더 2873 2001/02/22
5660             Re:Re:Re:한꼬맹이님~~~help 한꼬맹이 2913 2001/02/22
5665                 Re:Re:Re:Re:한꼬맹이님~~~help 시빌더 2975 2001/02/22
6414                     [답변아님]해결하셨으면 답변좀....ㅠ.ㅠ 양인석 2894 2001/03/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.