자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)

본 게시판은 개발자들이 자유롭게 질문과 답변을 공유하는 게시판입니다.
* 따라서 최대한 정중하게 질문을 올려 주세요.
* 질문을 상세히 작성해 주실 수록 좋은 답변이 올라 옵니다.
* 다른 분들도 참고할 수 있도록 결과 댓글 필수(또는 감사 댓글)
(결과 댓글을 달지 않는 경우 다음 질문에 대한 답변이 달리지 않는 불이익이 있을 수 있습니다.)
-----------------------------------------------------------------------------------------------

안녕하세요

10.1 도쿄버전 c++빌더 사용중입니다.

아래와 같이 특정 폴더에 있는 엑셀 파일을 열어서 수정하고 저장하는 기능을 구현중인데

"피호출자를 호출하지 못하였습니다."라는 오류 메시지가 뜨네요

그리고 작업관리자에 엑셀일 실행이 되고있어 일일일 수작업으로 지워줘야하구요

설정에 문제가 없는지 확인 부탁드립니다.

 


char dBuf[100];
int excel_col;
Variant excel_app;
Variant excel_book, excel_books;
Variant excel_sheet;
Variant excel_window;
Variant cells;
Variant Data;
Variant interior;
Variant column;
WideString ExcelData;
AnsiString asFileName;
Variant value;

 

String DefaultOpenPath={"C:\\ICS Default Set\\ICS Default Set.xlsx"};


void __fastcall TMainForm::Button_DefaultSaveClick(TObject *Sender)
{
  AnsiString TestStr, StrPoint;
  WideString Temp, SaveStr;
  char sTemp=0;


  Temp=DefaultOpenPath;

  excel_app=Variant::CreateObject("excel.application");                      //Excel 프로그램 실행
  excel_app.OlePropertySet("Visible", (Variant)false);                        //Excel 프로그램 Visible설정
  excel_app.OlePropertyGet("WorkBooks").OleProcedure("Open",Temp);
  excel_book=excel_app.OlePropertyGet("ActiveWorkbook");                     //현재 Active된 WorkBook 선택
  excel_sheet=excel_book.OlePropertyGet("ActiveSheet");                      // WorkBook에서 Acitve된 Sheet선택
  excel_app.OlePropertySet("DisplayAlerts", false);                                   //파일 저장 묻기 메시지 off
 

 

  TestStr=(Ru_MainForm->ComboBox_HighTemp->ItemIndex+80);
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",TempHighPoint[0], TempHighPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  if(Ru_MainForm->CheckBox_Fa1->Checked==false)    TestStr="OFF";
  else              TestStr="ON";
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",Fa1_SetupPoint[0], Fa1_SetupPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  if(Ru_MainForm->CheckBox_Fa5->Checked==false)    TestStr="OFF";
  else              TestStr="ON";
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",Fa5_SetupPoint[0], Fa5_SetupPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));


  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",AutoShutdownPoint[0], AutoShutdownPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  TestStr=(Ru_MainForm->ComboBox_ConDlInputUpper->ItemIndex+31)*-1;
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",DlInputUpperPoint[0], DlInputUpperPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  TestStr=(Ru_MainForm->ComboBox_ConDlInputLower->ItemIndex+50)*-1;
  strcpy(dBuf, TestStr.c_str());
  cells = excel_sheet.OlePropertyGet("Cells",DlInputLowerPoint[0], DlInputLowerPoint[1]);
  cells.OlePropertySet("Value", WideString(dBuf));

 

  SaveStr=DefaultOpenPath;
  excel_book.OleProcedure("SaveAs",SaveStr);
  excel_book.OleFunction("Close", (Variant)False);
  excel_sheet = Unassigned;
  excel_book = Unassigned;
  excel_app.OleFunction("Quit");
  excel_app = Unassigned;
}

 

번호 제목 글쓴이 날짜 조회 수
공지 [프로그래밍 강의] 2021.6~2021.12 관리자 2015.01.22 15761
공지 유용한 관련 사이트 관리자2 2014.03.20 54577
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 97974
3199 [10.3.3 브리핑] RAD서버의 부하 분산 등은 어떻게 되나요? 험프리 2019.12.10 77
3198 [RAD서버-201703 세미나] 리눅스 및 ARM 계열 크로스컴파일 업그레이드 일정 험프리 2017.03.17 77
3197 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 18 - Exercise 3 [1] 관리자 2016.05.27 79
3196 [10.2.2 세미나] 이전 버전과의 차별점 알려주시면 감사하겠습니다. 험프리 2018.01.18 79
3195 실행되지만 레퍼런스에 없는 system.default 2 임병기 2017.04.01 79
3194 디버깅을 하면서 메모리에 어떻게 할당됐는지 확인할 수 있나요? 손보라 2016.08.31 80
3193 [시애틀 출시세미나] 제품소개의 권장사항에 XP가 빠져있는데 XP에서도 사용할 수 있나요? Humphery 2015.09.11 81
3192 ActiveX 호환이 안되는 것인지 궁금합니다. KJ 2020.02.17 81
3191 설치및 구버젼 라인센스 [2] 희망나라 2020.07.02 81
3190 델파이 xe seattle 10 사용중 이미지 인쇄 버그 네이트 2020.11.17 81
3189 [개발생산성향상 세미나] 리눅스 지원은 언제쯤 하나요? 험프리 2017.02.22 83
3188 10.2 starter 언인스톨 문제 [3] 바람 2017.05.31 84
3187 rio update 질문입니다. [1] file 희망나라 2020.02.17 84
3186 간혹 . 를 찍어도 아무런 반응이 없는 경우.. 가나당 2016.12.22 85
3185 [100%활용 세미나] 리눅스 지원 계획을 알고 싶습니다. 험프리 2017.11.10 85
3184 시애틀에서 비콘사용문의 [1] tonetel 2016.08.16 86
3183 Berlin, Nougat 환경에서 TMemo 관련. [1] 까치발가락 2017.07.28 86
3182 RIO 10.3 폼 Transparency 활성시 검정색 문제 돌팅 2018.12.07 87
3181 아파치 RAD Server 연동 날개 2021.03.11 87
3180 문자열 관련 [1] 구뚜루 2018.12.25 88